From 8d1b390c7e8d4c870eff0fc4d1429dfce7090539 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 1 Aug 2004 04:10:54 +0000 Subject: [PATCH] Removed old iv plugin --- VisualStudio/VisualStudio.dsw | 21 - VisualStudio/osgPlugins/iv/iv.dsp | 218 --- src/osgPlugins/iv/COPYING | 481 ------ src/osgPlugins/iv/GNUmakefile | 21 - src/osgPlugins/iv/README | 21 - src/osgPlugins/iv/atrfloat.h | 33 - src/osgPlugins/iv/atrstring.h | 34 - src/osgPlugins/iv/atrvec.h | 53 - src/osgPlugins/iv/atrvec3list.h | 39 - src/osgPlugins/iv/attribute.h | 36 - src/osgPlugins/iv/coordinate3.h | 39 - src/osgPlugins/iv/geometry.h | 32 - src/osgPlugins/iv/indexedfaceset.h | 52 - src/osgPlugins/iv/indexedtristripset.h | 52 - src/osgPlugins/iv/ltstr.h | 38 - src/osgPlugins/iv/material.h | 33 - src/osgPlugins/iv/matrixtransform.h | 36 - src/osgPlugins/iv/mynode.h | 77 - src/osgPlugins/iv/mynodevisitor.h | 52 - src/osgPlugins/iv/nodecache.cpp | 22 - src/osgPlugins/iv/nodecache.h | 44 - src/osgPlugins/iv/normals.cpp | 109 -- src/osgPlugins/iv/normals.h | 27 - src/osgPlugins/iv/osgvisitor.cpp | 414 ----- src/osgPlugins/iv/osgvisitor.h | 55 - src/osgPlugins/iv/parser.cpp | 1457 ---------------- src/osgPlugins/iv/parser.hpp | 51 - src/osgPlugins/iv/parser.y | 170 -- src/osgPlugins/iv/readerwriter.cpp | 70 - src/osgPlugins/iv/readerwriter.h | 41 - src/osgPlugins/iv/scanner.cpp | 2123 ------------------------ src/osgPlugins/iv/scanner.l | 91 - src/osgPlugins/iv/separator.h | 33 - src/osgPlugins/iv/texture2.h | 33 - src/osgPlugins/iv/texturecoordinate.h | 37 - src/osgPlugins/iv/transform.h | 33 - 36 files changed, 6178 deletions(-) delete mode 100644 VisualStudio/osgPlugins/iv/iv.dsp delete mode 100644 src/osgPlugins/iv/COPYING delete mode 100644 src/osgPlugins/iv/GNUmakefile delete mode 100644 src/osgPlugins/iv/README delete mode 100644 src/osgPlugins/iv/atrfloat.h delete mode 100644 src/osgPlugins/iv/atrstring.h delete mode 100644 src/osgPlugins/iv/atrvec.h delete mode 100644 src/osgPlugins/iv/atrvec3list.h delete mode 100644 src/osgPlugins/iv/attribute.h delete mode 100644 src/osgPlugins/iv/coordinate3.h delete mode 100644 src/osgPlugins/iv/geometry.h delete mode 100644 src/osgPlugins/iv/indexedfaceset.h delete mode 100644 src/osgPlugins/iv/indexedtristripset.h delete mode 100644 src/osgPlugins/iv/ltstr.h delete mode 100644 src/osgPlugins/iv/material.h delete mode 100644 src/osgPlugins/iv/matrixtransform.h delete mode 100644 src/osgPlugins/iv/mynode.h delete mode 100644 src/osgPlugins/iv/mynodevisitor.h delete mode 100644 src/osgPlugins/iv/nodecache.cpp delete mode 100644 src/osgPlugins/iv/nodecache.h delete mode 100644 src/osgPlugins/iv/normals.cpp delete mode 100644 src/osgPlugins/iv/normals.h delete mode 100644 src/osgPlugins/iv/osgvisitor.cpp delete mode 100644 src/osgPlugins/iv/osgvisitor.h delete mode 100644 src/osgPlugins/iv/parser.cpp delete mode 100644 src/osgPlugins/iv/parser.hpp delete mode 100644 src/osgPlugins/iv/parser.y delete mode 100644 src/osgPlugins/iv/readerwriter.cpp delete mode 100644 src/osgPlugins/iv/readerwriter.h delete mode 100644 src/osgPlugins/iv/scanner.cpp delete mode 100644 src/osgPlugins/iv/scanner.l delete mode 100644 src/osgPlugins/iv/separator.h delete mode 100644 src/osgPlugins/iv/texture2.h delete mode 100644 src/osgPlugins/iv/texturecoordinate.h delete mode 100644 src/osgPlugins/iv/transform.h diff --git a/VisualStudio/VisualStudio.dsw b/VisualStudio/VisualStudio.dsw index 899190f54..50ea4c6df 100644 --- a/VisualStudio/VisualStudio.dsw +++ b/VisualStudio/VisualStudio.dsw @@ -2127,27 +2127,6 @@ Package=<4> ############################################################################### -Project: "osgPlugin iv"=.\osgPlugins\iv\iv.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name Core osg - End Project Dependency - Begin Project Dependency - Project_Dep_Name Core osgDB - End Project Dependency - Begin Project Dependency - Project_Dep_Name Core osgUtil - End Project Dependency -}}} - -############################################################################### - Project: "osgPlugin ive"=.\osgPlugins\ive\ive.dsp - Package Owner=<4> Package=<5> diff --git a/VisualStudio/osgPlugins/iv/iv.dsp b/VisualStudio/osgPlugins/iv/iv.dsp deleted file mode 100644 index 7b1b69e13..000000000 --- a/VisualStudio/osgPlugins/iv/iv.dsp +++ /dev/null @@ -1,218 +0,0 @@ -# Microsoft Developer Studio Project File - Name="osgPlugin iv" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=osgPlugin iv - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "iv.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "iv.mak" CFG="osgPlugin iv - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "osgPlugin iv - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "osgPlugin iv - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "osgPlugin iv - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLT_LIBRARY" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x414 /d "NDEBUG" -# ADD RSC /l 0x417 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 OpenThreadsWin32.lib /nologo /dll /pdb:none /machine:I386 /out:"../../../bin/osgdb_iv.dll" /libpath:"../../../lib" /libpath:"../../../../OpenThreads/lib/win32" /libpath:"../../../../Producer/lib" /libpath:"../../../../3rdParty/lib" - -!ELSEIF "$(CFG)" == "osgPlugin iv - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../../../lib" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /vmg /vd0 /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLT_LIBRARY" /D "WIN32" /D "_DEBUG" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x414 /d "_DEBUG" -# ADD RSC /l 0x417 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32d.lib /nologo /dll /pdb:"../../../bin/osgdb_ivd.pdb" /debug /machine:I386 /out:"../../../bin/osgdb_ivd.dll" /pdbtype:sept /libpath:"../../../lib" /libpath:"../../../../OpenThreads/lib/win32" /libpath:"../../../../Producer/lib" /libpath:"../../../../3rdParty/lib" -# SUBTRACT LINK32 /pdb:none /incremental:no - -!ENDIF - -# Begin Target - -# Name "osgPlugin iv - Win32 Release" -# Name "osgPlugin iv - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\nodecache.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\normals.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\osgvisitor.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\parser.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\readerwriter.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\scanner.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl;" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\atrfloat.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\atrstring.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\atrvec.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\atrvec3list.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\attribute.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\coordinate3.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\geometry.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\indexedfaceset.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\indexedtristripset.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\ltstr.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\material.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\matrixtransform.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\mynode.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\mynodevisitor.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\nodecache.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\normals.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\osgvisitor.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\readerwriter.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\separator.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\texture2.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\texturecoordinate.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\osgPlugins\iv\transform.h -# End Source File -# End Group -# End Target -# End Project diff --git a/src/osgPlugins/iv/COPYING b/src/osgPlugins/iv/COPYING deleted file mode 100644 index 92b8903ff..000000000 --- a/src/osgPlugins/iv/COPYING +++ /dev/null @@ -1,481 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/src/osgPlugins/iv/GNUmakefile b/src/osgPlugins/iv/GNUmakefile deleted file mode 100644 index a568488a8..000000000 --- a/src/osgPlugins/iv/GNUmakefile +++ /dev/null @@ -1,21 +0,0 @@ -TOPDIR = ../../.. -include $(TOPDIR)/Make/makedefs - -CXXFILES =\ - nodecache.cpp\ - normals.cpp\ - osgvisitor.cpp\ - readerwriter.cpp\ - scanner.cpp\ - parser.cpp\ - -INC += -I$(THISDIR) - -LIBS += $(OSG_LIBS) $(OTHER_LIBS) - -TARGET_BASENAME = iv - -include $(TOPDIR)/Make/cygwin_plugin_def -PLUGIN = $(PLUGIN_PREFIX)$(TARGET_BASENAME).$(PLUGIN_EXT) - -include $(TOPDIR)/Make/makerules diff --git a/src/osgPlugins/iv/README b/src/osgPlugins/iv/README deleted file mode 100644 index 61b14cab3..000000000 --- a/src/osgPlugins/iv/README +++ /dev/null @@ -1,21 +0,0 @@ -This shared library can load both VRML1.0 and Inventor (they are practically -the same, only changes the header). - -Features: - -* Polygonal geometry (IndexedFaceSet) -* Materials -* Transformations -* External Textures (no inline ones) -* Doesn't crash when unknown nodes or attributes are found, only ignores -them. - -To-Do: - -* Use the new Geometry node of osg 0.9.0 that has support of vertex arrays -* Use the front face attribute (clockwise/counterclockwise) -* Implement more nodes. Maybe the cone, sphere, etc could be implemented - with a fixed number of polygons, always the same, or maybe as a LOD node, - that uses more or less polys depending on the distance to the camera. - -Ruben lopez diff --git a/src/osgPlugins/iv/atrfloat.h b/src/osgPlugins/iv/atrfloat.h deleted file mode 100644 index 3ffd56c51..000000000 --- a/src/osgPlugins/iv/atrfloat.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ATR_FLOAT_H__ -#define __ATR_FLOAT_H__ - -#include "attribute.h" - -class AtrFloat: public Attribute { - float value; -public: - AtrFloat(char *name, float val):Attribute(name) { value=val; } - virtual char *type() { return "AtrFloat"; } - float getValue() { return value; } -}; - -#endif diff --git a/src/osgPlugins/iv/atrstring.h b/src/osgPlugins/iv/atrstring.h deleted file mode 100644 index 963ee046b..000000000 --- a/src/osgPlugins/iv/atrstring.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ATR_STRING_H__ -#define __ATR_STRING_H__ - -#include "attribute.h" - -class AtrString: public Attribute { - char *value; -public: - AtrString(char *name, char *value):Attribute(name) { this->value=strdup(value); } - ~AtrString() { free (value); } - virtual char *type() { return "AtrString"; } - char *getValue() { return value; } -}; - -#endif diff --git a/src/osgPlugins/iv/atrvec.h b/src/osgPlugins/iv/atrvec.h deleted file mode 100644 index 52a752f93..000000000 --- a/src/osgPlugins/iv/atrvec.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ATR_VEC_H__ -#define __ATR_VEC_H__ - -#include "attribute.h" - -class AtrVec: public Attribute { - std::vector values; -public: - AtrVec(char *name):Attribute(name) { } - AtrVec(char *name, float x, float y):Attribute(name) { - values.push_back(x); - values.push_back(y); - } - AtrVec(char *name, float x, float y, float z):Attribute(name) { - values.push_back(x); - values.push_back(y); - values.push_back(z); - } - AtrVec(char *name, float x, float y, float z, float k):Attribute(name) { - values.push_back(x); - values.push_back(y); - values.push_back(z); - values.push_back(k); - } - void addVal(float val) { values.push_back(val); } - float getVal(int pos) { return values[pos]; } - float getValABS(int pos) { return values[pos]>0?values[pos]:-values[pos]; } - float getValCut(int pos) { return values[pos]>0?values[pos]:0.0f; } - int getSize() { return values.size(); } - virtual char *type() { return "AtrVec"; } -}; - - -#endif diff --git a/src/osgPlugins/iv/atrvec3list.h b/src/osgPlugins/iv/atrvec3list.h deleted file mode 100644 index cef42c090..000000000 --- a/src/osgPlugins/iv/atrvec3list.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ATR_VEC3_LIST_H__ -#define __ATR_VEC3_LIST_H__ - -#include "attribute.h" -#include "geometry.h" - -class AtrVec3List: public Attribute { - VertexList *list; -public: - AtrVec3List(char *name):Attribute(name) { list=0; } - AtrVec3List(char *name, VertexList *vlist):Attribute(name) { - this->list=vlist; - } - VertexList *getList() { return list; } - int getSize() { return list->size(); } - virtual char *type() { return "AtrVec3List"; } -}; - - -#endif diff --git a/src/osgPlugins/iv/attribute.h b/src/osgPlugins/iv/attribute.h deleted file mode 100644 index f0a7aaf00..000000000 --- a/src/osgPlugins/iv/attribute.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ATTRIBUTE_H__ -#define __ATTRIBUTE_H__ - -#include - -class Attribute: public osg::Referenced { -public: - char *name; - virtual char *type()=0; - char *getName() { return name; } - -protected: - Attribute(char *name) {this->name=strdup(name); } - ~Attribute() {free(name); } -}; - -#endif diff --git a/src/osgPlugins/iv/coordinate3.h b/src/osgPlugins/iv/coordinate3.h deleted file mode 100644 index 8505f3a7a..000000000 --- a/src/osgPlugins/iv/coordinate3.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __COORDINATE3_H__ -#define __COORDINATE3_H__ - -#include "geometry.h" -#include "mynode.h" - -class Coordinate3: public MyNode { - VertexList vertices; -public: - Coordinate3(VertexList *vertices) { - this->vertices=*vertices; - } - virtual char *type() { return "Coordinate3"; } - virtual void accept(MyNodeVisitor *v) { v->applyCoordinate3(this); } - VertexList getVertices() { return vertices; } - -}; - - -#endif diff --git a/src/osgPlugins/iv/geometry.h b/src/osgPlugins/iv/geometry.h deleted file mode 100644 index 9c9147b7e..000000000 --- a/src/osgPlugins/iv/geometry.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __GEOMETRY_H__ -#define __GEOMETRY_H__ - -#include -#include - -typedef std::vector VertexList; -typedef std::vector VertexIndexList; -typedef std::pair TextureCoordVal; -typedef std::vector TextureCoordList; -typedef std::vector PolygonList; -typedef float Matrix[16]; -#endif diff --git a/src/osgPlugins/iv/indexedfaceset.h b/src/osgPlugins/iv/indexedfaceset.h deleted file mode 100644 index 454e64f29..000000000 --- a/src/osgPlugins/iv/indexedfaceset.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __INDEXED_FACE_SET_H__ -#define __INDEXED_FACE_SET_H__ - -#include "mynode.h" - -class IndexedFaceSet: public MyNode { - PolygonList polys; - PolygonList textureIndices; // Indexed texture set. - bool _hasTextureIndices; -public: - IndexedFaceSet() {} - - IndexedFaceSet(PolygonList *p) { - polys=*p; - _hasTextureIndices=false; - } - - IndexedFaceSet(PolygonList *p, PolygonList *t) { - polys=*p; - textureIndices=*t; - _hasTextureIndices=true; - } - - bool hasTextureIndices() { return _hasTextureIndices; } - PolygonList getPolygons() { return polys; } - PolygonList getTextureIndices() { return textureIndices; } - virtual char *type() { return "IndexedFaceSet"; } - virtual void accept(MyNodeVisitor *v) { v->applyIndexedFaceSet(this); } - -}; - - -#endif diff --git a/src/osgPlugins/iv/indexedtristripset.h b/src/osgPlugins/iv/indexedtristripset.h deleted file mode 100644 index 9086843ec..000000000 --- a/src/osgPlugins/iv/indexedtristripset.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __INDEXED_TRI_STRIP_SET_H__ -#define __INDEXED_TRI_STRIP_SET_H__ - -#include "mynode.h" - -class IndexedTriStripSet: public MyNode { - PolygonList polys; - PolygonList textureIndices; // Indexed texture set. - bool _hasTextureIndices; -public: - IndexedTriStripSet() {} - - IndexedTriStripSet(PolygonList *p) { - polys=*p; - _hasTextureIndices=false; - } - - IndexedTriStripSet(PolygonList *p, PolygonList *t) { - polys=*p; - textureIndices=*t; - _hasTextureIndices=true; - } - - bool hasTextureIndices() { return _hasTextureIndices; } - PolygonList getPolygons() { return polys; } - PolygonList getTextureIndices() { return textureIndices; } - virtual char *type() { return "IndexedTriStripSet"; } - virtual void accept(MyNodeVisitor *v) { v->applyIndexedTriStripSet(this); } - -}; - - -#endif diff --git a/src/osgPlugins/iv/ltstr.h b/src/osgPlugins/iv/ltstr.h deleted file mode 100644 index eb9308a8d..000000000 --- a/src/osgPlugins/iv/ltstr.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LTSTR_H__ -#define __LTSTR_H__ - -#include - -/** @class ltstr - * - * @brief clase/estructura que implementa un algoritmo de comparacion - * de dos cadenas para mapas cuyo indice es una cadena. - */ -struct ltstr -{ - bool operator()(const char* s1, const char* s2) const - { - return strcmp(s1, s2) < 0; - } -}; - -#endif diff --git a/src/osgPlugins/iv/material.h b/src/osgPlugins/iv/material.h deleted file mode 100644 index 6913c0454..000000000 --- a/src/osgPlugins/iv/material.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __MATERIAL_H__ -#define __MATERIAL_H__ - -#include "mynode.h" - -class Material: public MyNode { -public: - Material() {} - Material(MyNode *n): MyNode(n) {} - virtual char *type() { return "Material"; } - virtual void accept(MyNodeVisitor *v) { v->applyMaterial(this); } -}; - -#endif diff --git a/src/osgPlugins/iv/matrixtransform.h b/src/osgPlugins/iv/matrixtransform.h deleted file mode 100644 index 429a65062..000000000 --- a/src/osgPlugins/iv/matrixtransform.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __MATRIX_TRANSFORM_H__ -#define __MATRIX_TRANSFORM_H__ - -#include "mynode.h" -#include "geometry.h" - -class MatrixTransform: public MyNode { - Matrix m; -public: - MatrixTransform(Matrix m) {memcpy(this->m,m,sizeof(float)*16);} - float getElem(int i) { return m[i]; } - virtual char *type() { return "MatrixTransform"; } - virtual void accept(MyNodeVisitor *v) { v->applyMatrixTransform(this); } - -}; - -#endif diff --git a/src/osgPlugins/iv/mynode.h b/src/osgPlugins/iv/mynode.h deleted file mode 100644 index 570505903..000000000 --- a/src/osgPlugins/iv/mynode.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __NODE_H__ -#define __NODE_H__ - -#include -#include - -#include -#include -#include -#include "attribute.h" -#include "mynodevisitor.h" -#include "ltstr.h" - -#ifdef WIN32 -# pragma warning (disable:4786) -#endif - -class MyNode : public osg::Referenced { -public: - typedef std::vector< osg::ref_ptr > MyNodeList; - typedef std::map< const char*, osg::ref_ptr, ltstr > AttributeMap; -protected: - MyNodeList children; - AttributeMap attributes; - bool two_sided; -public: - MyNode() {two_sided=false;} - MyNode(const MyNode *other) { children=other->children; attributes=other->attributes; two_sided=false; } - virtual char *type() { return "MyNode"; } ///< Returns generic type - void addAttribute(char *name, Attribute *atr) { attributes[name]=atr; } - void addChild(MyNode *node) { children.push_back(node); } - MyNodeList getChildren() { return children; } - AttributeMap getAttributes() { return attributes; } - Attribute *getAttribute(char *name) { - if (attributes.find(name) != attributes.end()) { - return attributes[name].get(); - } else { - return 0; - } - } - void setChildren(MyNodeList children) { this->children=children; } - void setAttributes(AttributeMap attributes) { this->attributes=attributes; } - - void print(int indent) { - for (int i=0;i node = *iter; - node->print(indent+4); - } - } - void setTwoSided() { two_sided=true; } - bool getTwoSided() { return two_sided; } - virtual void accept(MyNodeVisitor *v) { v->applyMyNode(this); } -}; - -#endif diff --git a/src/osgPlugins/iv/mynodevisitor.h b/src/osgPlugins/iv/mynodevisitor.h deleted file mode 100644 index 0a5b51850..000000000 --- a/src/osgPlugins/iv/mynodevisitor.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __MY_NODE_VISITOR_H__ -#define __MY_NODE_VISITOR_H__ - -class MyNode; -class Material; -class Coordinate3; -class MatrixTransform; -class Separator; -class IndexedFaceSet; -class IndexedTriStripSet; -class TextureCoordinate; -class Texture2; -class Transform; - -#include - -class MyNodeVisitor: public osg::Referenced { -public: - virtual void applyMyNode(MyNode *node)=0; - virtual void applyMaterial(Material *material)=0; - virtual void applyCoordinate3(Coordinate3 *coord)=0; - virtual void applyMatrixTransform(MatrixTransform *tr)=0; - virtual void applySeparator(Separator *sep)=0; - virtual void applyIndexedFaceSet(IndexedFaceSet *ifs)=0; - virtual void applyIndexedTriStripSet(IndexedTriStripSet *its)=0; - virtual void applyTextureCoordinate(TextureCoordinate *texc)=0; - virtual void applyTexture2(Texture2 *tex)=0; - virtual void applyTransform(Transform *trans)=0; -}; - - -#endif - diff --git a/src/osgPlugins/iv/nodecache.cpp b/src/osgPlugins/iv/nodecache.cpp deleted file mode 100644 index 52013609b..000000000 --- a/src/osgPlugins/iv/nodecache.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "nodecache.h" - -NodeCache::NodeMap NodeCache::nodes; diff --git a/src/osgPlugins/iv/nodecache.h b/src/osgPlugins/iv/nodecache.h deleted file mode 100644 index 7148e9858..000000000 --- a/src/osgPlugins/iv/nodecache.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __CACHE_NODOS_H__ -#define __CACHE_NODOS_H__ - -#include -#include "mynode.h" -#include "ltstr.h" - -class NodeCache { - typedef std::map, ltstr > NodeMap; - static NodeMap nodes; -public: - static void addNode(char *name, MyNode *node) { - nodes[name]=node; - } - static MyNode* getNode(char *name) { - if (nodes.find(name) != nodes.end()) { - return nodes[name].get(); - } else { - std::cerr << "Node does not exist" << std::endl; - return new MyNode(); - } - } -}; - -#endif diff --git a/src/osgPlugins/iv/normals.cpp b/src/osgPlugins/iv/normals.cpp deleted file mode 100644 index 34fd61358..000000000 --- a/src/osgPlugins/iv/normals.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include - -#include "normals.h" - -#define CREASE_ANGLE 3.14159265356 * 45 / 180 - -float difAng(osg::Vec3 a, osg::Vec3 b) { - float div = a.length() * b.length(); - return (div != 0.0f ? acosf( (a*b) / div) : 0.0f ); -} - -osg::Vec3 calcNormal(osg::Vec3 &a, osg::Vec3 &b, osg::Vec3 &c) { - osg::Vec3 norm; - osg::Vec3 v1; - osg::Vec3 v2; - v1=b-c; - v2=a-b; - norm=v1 ^ v2; // cross product - norm.normalize(); - return norm; -} - -void get3v(VertexList &vertices, VertexIndexList &vindex, int &a, int &b, int &c) { - unsigned tam=vindex.size(); - unsigned i; - b=0;c=0; - a=vindex[0]; - for (i=1;i 2) { - int v0,v1,v2; - get3v(vertices,vindex,v0,v1,v2); - if (v0 == v1 || v0 == v2) { - osg::notify(osg::WARN) << "ERROR: Vertices alineados: nv=" << vindex.size() << std::endl; - } - normales_polys[poly] = calcNormal(vertices[v0], - vertices[v1], - vertices[v2]); - if (normales_polys[poly] == osg::Vec3(0,0,0) && vindex.size() > 2) { - osg::notify(osg::WARN) << "##***" << "Normal nula VERTICES=" << vindex.size() << " " << vertices[v0] << " " << vertices[v1] << " " << vertices[v2] << std::endl; - } - } - } - /* Phase 2: Selective smooth depending on crease angle */ - for (poly=0;poly - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include "geometry.h" - -osg::Vec3 calcNormal(osg::Vec3 &a, osg::Vec3 &b, osg::Vec3 &c); - -osg::Vec3 *calcNormals(VertexList &vertices, - PolygonList &polygons, - unsigned nvert_total); diff --git a/src/osgPlugins/iv/osgvisitor.cpp b/src/osgPlugins/iv/osgvisitor.cpp deleted file mode 100644 index 132a3d1b4..000000000 --- a/src/osgPlugins/iv/osgvisitor.cpp +++ /dev/null @@ -1,414 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include -#include "osgvisitor.h" -#include "material.h" -#include "coordinate3.h" -#include "separator.h" -#include "matrixtransform.h" -#include "indexedfaceset.h" -#include "indexedtristripset.h" -#include "texturecoordinate.h" -#include "texture2.h" -#include "transform.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include ///< Para calcular normals -#include ///< Para convertir a tristrip - - -#include "atrvec.h" -#include "atrfloat.h" -#include "atrstring.h" -#include "atrvec3list.h" - -#include "ltstr.h" -#include "normals.h" - -#define CREASE_ANGLE 2//3.14159265359 * 2.0 / 3.0 - -class ObjectCache { - typedef std::map, osg::ref_ptr > MaterialMap; - typedef std::map, ltstr> TextureMap; - typedef std::map, osg::ref_ptr > NodeMap; - - static MaterialMap materials; - static TextureMap textures; - static NodeMap nodos; -public: - static osg::Node* getMyNode(MyNode*) { - return 0; - } - - static osg::Material* getMaterial(Material* _material) { - if (materials.find(_material) == materials.end()) { - AtrVec *ambient=dynamic_cast(_material->getAttribute("ambientColor")); - AtrVec *diffuse=dynamic_cast(_material->getAttribute("diffuseColor")); - AtrVec *specular=dynamic_cast(_material->getAttribute("specularColor")); - AtrFloat *shininess=dynamic_cast(_material->getAttribute("shininess")); - AtrFloat *transparency=dynamic_cast(_material->getAttribute("transparency")); - osg::Material *material=new osg::Material(); - if (ambient) material->setAmbient(osg::Material::FRONT_AND_BACK,osg::Vec4(ambient->getValCut(0),ambient->getValCut(1),ambient->getValCut(2),1.0f)); - if (diffuse) material->setDiffuse(osg::Material::FRONT_AND_BACK,osg::Vec4(diffuse->getValCut(0),diffuse->getValCut(1),diffuse->getValCut(2),1.0f)); - if (specular) material->setSpecular(osg::Material::FRONT_AND_BACK,osg::Vec4(specular->getValCut(0),specular->getValCut(1),specular->getValCut(2),1.0f)); - if (shininess) material->setShininess(osg::Material::FRONT_AND_BACK,shininess->getValue()); - if (transparency) material->setTransparency(osg::Material::FRONT_AND_BACK,transparency->getValue()); - if (ambient || diffuse || specular || transparency) - materials[_material]=material; - else return 0; - } - return materials[_material].get(); - } - - static osg::Texture2D* getTextura(const char* _texture) { - if (textures.find(_texture) == textures.end()) { - osg::Texture2D *texture=new osg::Texture2D(); - texture->setImage(osgDB::readImageFile(_texture)); - texture->setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::REPEAT); - texture->setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::REPEAT); - osg::notify(osg::INFO) << "Loading texture " << _texture << std::endl; - textures[_texture]=texture; - } - return textures[_texture].get(); - } -}; - -ObjectCache::MaterialMap ObjectCache::materials; -ObjectCache::TextureMap ObjectCache::textures; -ObjectCache::NodeMap ObjectCache::nodos; - -static void makeTransform(MatrixTransform *matriz_active, osg::MatrixTransform *nodo) { - // Original - osg::Matrix m(matriz_active->getElem(0),matriz_active->getElem(1),matriz_active->getElem(2),matriz_active->getElem(3), - matriz_active->getElem(4),matriz_active->getElem(5),matriz_active->getElem(6),matriz_active->getElem(7), - matriz_active->getElem(8),matriz_active->getElem(9),matriz_active->getElem(10),matriz_active->getElem(11), - matriz_active->getElem(12),matriz_active->getElem(13),matriz_active->getElem(14),matriz_active->getElem(15)); - nodo->setMatrix(m); -} - -OSGVisitor::OSGVisitor(MyNode *nodo) { - root=0; - parent=0; - coord3_active=0; - tcoord_active=0; - texture_active=0; - material_active=0; - total_vert=0; - two_sided=false; - nodo->accept(this); - osg::notify(osg::INFO) << "Model of " << total_vert << " vertices" << std::endl; -} - -void OSGVisitor::applyMyNode(MyNode *) { -} - -void OSGVisitor::applyMaterial(Material *material) { - material_active=material; -} - -void OSGVisitor::applyCoordinate3(Coordinate3 *coord) { - coord3_active=coord; -} - -void OSGVisitor::applyMatrixTransform(MatrixTransform *tr) -{ - makeTransform(tr,parent); -} - -void OSGVisitor::applySeparator(Separator *sep) -{ - osg::MatrixTransform *group=new osg::MatrixTransform(); - if (root==0) { - root=group; - } - if (parent!=0) { - parent->addChild(group); - } - two_sided=false; - MyNode::MyNodeList hijos=sep->getChildren(); - for (MyNode::MyNodeList::iterator iter=hijos.begin();iter!=hijos.end();iter++) { - osg::ref_ptr hijo=*iter; - parent=group; - hijo->accept(this); - } -} - -osg::PrimitiveSet *generatePrimitive(PolygonList &polys, unsigned primsize, unsigned numvertices) { - unsigned i,j; - osg::PrimitiveSet *p=0; - // Fisrt of all count the number of polygons - unsigned count=0; - for (i=0;isetMode(osg::FrontFace::CLOCKWISE); - state->setAttributeAndModes(frontface,osg::StateAttribute::ON); - osg::CullFace *cull=new osg::CullFace(); - cull->setMode(osg::CullFace::BACK); - if (!twoSided) { - state->setAttributeAndModes(cull,osg::StateAttribute::ON); - } else { - //osg::notify(osg::INFO) << "Deactivating culling for this object" << std::endl; - state->setAttributeAndModes(cull,osg::StateAttribute::OFF); - osg::BlendFunc *transp=new osg::BlendFunc(); - transp->setFunction(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - state->setAttribute(transp); - state->setMode(GL_BLEND,osg::StateAttribute::ON); - state->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); - } - geode->setStateSet(state); - /** Applying the material */ - if (material_active!=0) { - osg::Material *material = ObjectCache::getMaterial(material_active); - state->setAttributeAndModes(material,osg::StateAttribute::ON); - } - /** Applying the texture */ - if (texture_active!=0) { - AtrString *filename=(AtrString*)texture_active->getAttribute("filename"); - if (filename) { - osg::Texture2D *texture=ObjectCache::getTextura(filename->getValue()); - state->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); - } - } - - /* If needed, apply per-vertex colors */ - if (material_active) { - AtrVec3List *diffuse=dynamic_cast(material_active->getAttribute("diffuseColor")); - if (diffuse) { // Has per-vertex colors - osg::notify(osg::INFO) << "Per vertex colors" << std::endl; - VertexList *colors=diffuse->getList(); - osg::Vec3Array *colors_osg=new osg::Vec3Array(); - for (unsigned i=0;isize();i++) { - colors_osg->push_back((*colors)[i]); - } - osg::notify(osg::INFO) << colors->size() << " colors" << std::endl; - geometry->setColorArray(colors_osg); - geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX); - } - } -} - -void OSGVisitor::applyIndexedFaceSet(IndexedFaceSet *ifs) { - unsigned i; - if (coord3_active == 0) { - std::cerr << "ERROR: IndexedFaceSet without previous Coordinate3!" << std::endl; - throw -1; - } - osg::Geode *geode=new osg::Geode(); - osg::Geometry *geometry=new osg::Geometry(); - makeGeode(geode,geometry,ifs->getTwoSided()); - /* Converting list of vertices to the OSG way (mostly the same) */ - VertexList vertices=coord3_active->getVertices(); - osg::Vec3Array *vertices_osg=new osg::Vec3Array(); - for (i=0;ipush_back(vertices[i]); - } - geometry->setVertexArray(vertices_osg); - total_vert+=vertices.size(); - - /* Converting list of polys */ - PolygonList polys=ifs->getPolygons(); - for (i=1;i<=4;i++) { - osg::PrimitiveSet *p=generatePrimitive(polys,i,vertices.size()); - if (p!=0) { - geometry->addPrimitiveSet(p); - } - } - TextureCoordList tcoord; - if (tcoord_active) tcoord=tcoord_active->getTextureCoords(); - PolygonList textureIndices = ifs->getTextureIndices(); - if (tcoord_active) { - if (ifs->hasTextureIndices()) { - std::cerr << "texture indices are not supported!" << std::endl; - } else { - osg::Vec2Array *texCoords=new osg::Vec2Array(); - for (i=0;ipush_back(osg::Vec2(tcoord[i].first,tcoord[i].second)); - } - geometry->setTexCoordArray(0,texCoords); - } - } - - osgUtil::SmoothingVisitor v; - v.smooth(*geometry); - - // As SmoothingVisitor doesn't take the front face into account: - osg::Vec3Array *norm=geometry->getNormalArray(); - for (i=0;isize();i++) { - (*norm)[i] = - (*norm)[i]; - } - - geode->addDrawable(geometry); - parent->addChild(geode); -} - -void OSGVisitor::applyIndexedTriStripSet(IndexedTriStripSet *its) { - unsigned i,j; - if (coord3_active == 0) { - std::cerr << "ERROR: IndexedFaceSet without previous Coordinate3!" << std::endl; - throw -1; - } - osg::Geode *geode=new osg::Geode(); - osg::Geometry *geometry=new osg::Geometry(); - makeGeode(geode,geometry,its->getTwoSided()); - /* Converting list of vertices to the OSG way (mostly the same) */ - VertexList vertices=coord3_active->getVertices(); - osg::Vec3Array *vertices_osg=new osg::Vec3Array(); - for (i=0;ipush_back(vertices[i]); - } - geometry->setVertexArray(vertices_osg); - total_vert+=vertices.size(); - - /* Converting list of polys */ - PolygonList polys=its->getPolygons(); - for (i=0;iaddPrimitiveSet(new osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLE_STRIP,vindex.size(),indices)); - } - - - TextureCoordList tcoord; - if (tcoord_active) tcoord=tcoord_active->getTextureCoords(); - PolygonList textureIndices = its->getTextureIndices(); - if (tcoord_active) { - if (its->hasTextureIndices()) { - std::cerr << "texture indices are not supported!" << std::endl; - } else { - osg::Vec2Array *texCoords=new osg::Vec2Array(); - for (i=0;ipush_back(osg::Vec2(tcoord[i].first,tcoord[i].second)); - } - geometry->setTexCoordArray(0,texCoords); - } - } - - osgUtil::SmoothingVisitor v; - v.smooth(*geometry); - - // As SmoothingVisitor doesn't take the front face into account: - osg::Vec3Array *norm=geometry->getNormalArray(); - for (i=0;isize();i++) { - (*norm)[i] = - (*norm)[i]; - } - - geode->addDrawable(geometry); - parent->addChild(geode); -} - - -void OSGVisitor::applyTextureCoordinate(TextureCoordinate *texc) { - tcoord_active=texc; -} - -void OSGVisitor::applyTexture2(Texture2 *tex) { - texture_active=tex; -} - -void OSGVisitor::applyTransform(Transform *trans) { - osg::Matrix scale; - osg::Matrix rotate; - osg::Matrix translate; - AtrVec *_scale=(AtrVec*)trans->getAttribute("scaleFactor"); - AtrVec *_rotate=(AtrVec*)trans->getAttribute("rotation"); - AtrVec *_translate=(AtrVec*)trans->getAttribute("translation"); - if (_scale) { - scale.makeScale(_scale->getVal(0),_scale->getVal(1),_scale->getVal(2)); - } - if (_rotate) { - rotate.makeRotate(_rotate->getVal(3),_rotate->getVal(0),_rotate->getVal(1),_rotate->getVal(2)); - } - if (_translate) { - translate.makeTranslate(_translate->getVal(0),_translate->getVal(1),_translate->getVal(2)); - } - parent->setMatrix(scale*rotate*translate); -} - - -osg::Node* OSGVisitor::getRoot() { - return root; -} - diff --git a/src/osgPlugins/iv/osgvisitor.h b/src/osgPlugins/iv/osgvisitor.h deleted file mode 100644 index e6ee54774..000000000 --- a/src/osgPlugins/iv/osgvisitor.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __VISITANTE_OSG_H__ -#define __VISITANTE_OSG_H__ - -#include "mynodevisitor.h" -#include -#include -#include - -class OSGVisitor: public MyNodeVisitor { - osg::Node *root; - osg::MatrixTransform *parent; - Coordinate3 *coord3_active; - TextureCoordinate *tcoord_active; - Texture2 *texture_active; - Material *material_active; - int total_vert; - bool two_sided; -public: - OSGVisitor(MyNode *node); - - virtual void applyMyNode(MyNode* node); - virtual void applyMaterial(Material *material); - virtual void applyCoordinate3(Coordinate3 *coord); - virtual void applyMatrixTransform(MatrixTransform *tr); - virtual void applySeparator(Separator *sep); - virtual void applyIndexedFaceSet(IndexedFaceSet *ifs); - virtual void applyIndexedTriStripSet(IndexedTriStripSet *its); - virtual void applyTextureCoordinate(TextureCoordinate *texc); - virtual void applyTexture2(Texture2 *tex); - virtual void applyTransform(Transform *trans); - osg::Node* getRoot(); -private: - void makeGeode(osg::Geode *geode, osg::Geometry *geometry, bool twoSided); -}; - -#endif diff --git a/src/osgPlugins/iv/parser.cpp b/src/osgPlugins/iv/parser.cpp deleted file mode 100644 index db91b1bbe..000000000 --- a/src/osgPlugins/iv/parser.cpp +++ /dev/null @@ -1,1457 +0,0 @@ -/* A Bison parser, made from parser.y - by GNU bison 1.35. */ - -#define YYBISON 1 /* Identify Bison output. */ - -# define STRING 257 -# define QUOTED_STRING 258 -# define FLOAT 259 -# define INT 260 -# define SEPARATOR 261 -# define DEF 262 -# define UN_MATERIAL 263 -# define DIFFUSE_COLOR 264 -# define COORDINATE3 265 -# define INDEXED_FACE_SET 266 -# define INDEXED_TRIANGLE_STRIP_SET 267 -# define A_POINT 268 -# define COORD_INDEX 269 -# define TEXTURE_COORD_INDEX 270 -# define NORMAL_INDEX 271 -# define TEXTURE_COORDINATE 272 -# define TEXTURE2 273 -# define MATRIX_TRANSFORM 274 -# define MATRIX 275 -# define LISTA_VACIA 276 -# define FINPOLY 277 -# define TWO_SIDED 278 -# define VECTOR 279 -# define VRML_HEADER 280 -# define TRANSFORM 281 -# define USE 282 - -#line 1 "parser.y" - -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef WIN32 -# pragma warning (disable:4786) -# pragma warning (disable:4541) -#endif - -// Where is malloc.h really needed? -#if !defined(__APPLE__) && !defined(macintosh) -#include -#endif - -#include "mynode.h" -#include -#include "geometry.h" -#include "nodecache.h" - -#include "material.h" -#include "coordinate3.h" -#include "separator.h" -#include "matrixtransform.h" -#include "indexedfaceset.h" -#include "indexedtristripset.h" -#include "texturecoordinate.h" -#include "texture2.h" -#include "transform.h" - -#include "atrfloat.h" -#include "atrstring.h" -#include "atrvec.h" -#include "atrvec3list.h" -#include "string.h" -extern int yyline; -extern int yylex(); -void yyerror(char *str,...); -static MyNode *root_node; - - -#line 54 "parser.y" -#ifndef YYSTYPE -typedef union { - char *s_value; - float f_value; - MyNode *nodo; - Attribute *attribute; - VertexList *vlist; - VertexIndexList *vindex; - TextureCoordList *tcoord; - PolygonList *plist; - Matrix matrix; - int i_value; -} yystype; -# define YYSTYPE yystype -# define YYSTYPE_IS_TRIVIAL 1 -#endif -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif - - - -#define YYFINAL 140 -#define YYFLAG -32768 -#define YYNTBASE 33 - -/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ -#define YYTRANSLATE(x) ((unsigned)(x) <= 282 ? yytranslate[x] : 42) - -/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ -static const char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 31, 2, 32, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 29, 2, 30, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28 -}; - -#if YYDEBUG -static const short yyprhs[] = -{ - 0, 0, 3, 8, 13, 21, 29, 41, 53, 62, - 75, 88, 96, 108, 120, 126, 134, 139, 144, 149, - 150, 153, 158, 161, 165, 170, 175, 176, 179, 180, - 183, 185, 202, 205, 208, 212, 217, 223, 226, 231, - 235 -}; -static const short yyrhs[] = -{ - 26, 34, 0, 9, 29, 35, 30, 0, 19, 29, - 35, 30, 0, 11, 29, 14, 31, 36, 32, 30, - 0, 12, 29, 15, 31, 37, 32, 30, 0, 12, - 29, 15, 31, 37, 32, 16, 31, 37, 32, 30, - 0, 12, 29, 15, 31, 37, 32, 17, 31, 37, - 32, 30, 0, 12, 29, 24, 15, 31, 37, 32, - 30, 0, 12, 29, 24, 15, 31, 37, 32, 16, - 31, 37, 32, 30, 0, 12, 29, 24, 15, 31, - 37, 32, 17, 31, 37, 32, 30, 0, 13, 29, - 15, 31, 37, 32, 30, 0, 13, 29, 15, 31, - 37, 32, 16, 31, 37, 32, 30, 0, 13, 29, - 15, 31, 37, 32, 17, 31, 37, 32, 30, 0, - 20, 29, 21, 39, 30, 0, 18, 29, 14, 31, - 41, 32, 30, 0, 27, 29, 35, 30, 0, 3, - 29, 35, 30, 0, 7, 29, 35, 30, 0, 0, - 35, 40, 0, 35, 8, 3, 34, 0, 35, 34, - 0, 35, 28, 3, 0, 25, 31, 36, 32, 0, - 36, 5, 5, 5, 0, 0, 37, 38, 0, 0, - 6, 38, 0, 23, 0, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 0, 3, 5, 0, 3, 3, 0, 3, 5, - 5, 0, 3, 5, 5, 5, 0, 3, 5, 5, - 5, 5, 0, 3, 4, 0, 3, 31, 36, 32, - 0, 41, 5, 5, 0, 0 -}; - -#endif - -#if YYDEBUG -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const short yyrline[] = -{ - 0, 94, 97, 99, 100, 101, 102, 103, 104, 105, - 106, 108, 109, 110, 111, 112, 113, 114, 115, 118, - 119, 120, 121, 122, 123, 126, 127, 130, 131, 134, - 135, 138, 146, 147, 148, 149, 150, 151, 152, 155, - 156 -}; -#endif - - -#if (YYDEBUG) || defined YYERROR_VERBOSE - -/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ -static const char *const yytname[] = -{ - "$", "error", "$undefined.", "STRING", "QUOTED_STRING", "FLOAT", "INT", - "SEPARATOR", "DEF", "UN_MATERIAL", "DIFFUSE_COLOR", "COORDINATE3", - "INDEXED_FACE_SET", "INDEXED_TRIANGLE_STRIP_SET", "A_POINT", - "COORD_INDEX", "TEXTURE_COORD_INDEX", "NORMAL_INDEX", - "TEXTURE_COORDINATE", "TEXTURE2", "MATRIX_TRANSFORM", "MATRIX", - "LISTA_VACIA", "FINPOLY", "TWO_SIDED", "VECTOR", "VRML_HEADER", - "TRANSFORM", "USE", "'{'", "'}'", "'['", "']'", "vrml_file", "node", - "node_contents", "points", "polylist", "vertexilist", "matrix", "attr", - "coords", 0 -}; -#endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const short yyr1[] = -{ - 0, 33, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, - 35, 35, 35, 35, 35, 36, 36, 37, 37, 38, - 38, 39, 40, 40, 40, 40, 40, 40, 40, 41, - 41 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const short yyr2[] = -{ - 0, 2, 4, 4, 7, 7, 11, 11, 8, 12, - 12, 7, 11, 11, 5, 7, 4, 4, 4, 0, - 2, 4, 2, 3, 4, 4, 0, 2, 0, 2, - 1, 16, 2, 2, 3, 4, 5, 2, 4, 3, - 0 -}; - -/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE - doesn't specify something else to do. Zero means the default is an - error. */ -static const short yydefact[] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 19, 19, 19, 0, 0, 0, 0, - 19, 0, 19, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 26, 0, 0, 0, 17, - 22, 20, 18, 2, 26, 28, 0, 28, 40, 3, - 0, 0, 16, 0, 33, 37, 32, 26, 0, 23, - 0, 0, 28, 0, 0, 0, 14, 0, 24, 34, - 0, 21, 0, 0, 30, 0, 27, 0, 0, 0, - 0, 0, 0, 35, 38, 4, 29, 0, 0, 5, - 0, 0, 0, 11, 39, 15, 0, 25, 36, 28, - 28, 0, 0, 8, 28, 28, 0, 0, 0, 28, - 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 6, 7, 0, 0, 12, 13, 0, 9, 10, - 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, - 0 -}; - -static const short yydefgoto[] = -{ - 138, 40, 24, 53, 61, 76, 51, 41, 64 -}; - -static const short yypact[] = -{ - -16, 157, -8, -2, 12, 13, 15, 21, 22, 32, - 38, 44,-32768, 53, 53, 53, 31, 25, 59, 65, - 53, 68, 53, 62, 5, 57, 83, 66, 73, 91, - 88, 94, 109, 102, 135,-32768, 0, 120, 123,-32768, - -32768,-32768,-32768,-32768,-32768,-32768, 99,-32768,-32768,-32768, - 128, 104,-32768, -4,-32768,-32768, 130,-32768, 157,-32768, - 2, 14,-32768, 16, 4, 136,-32768, 144,-32768, 145, - 6,-32768, 110, 20,-32768, 115,-32768, 24, 141, 146, - 122, 151, 154, 162,-32768,-32768,-32768, 143, 147,-32768, - 156, 150, 152,-32768,-32768,-32768, 177,-32768,-32768,-32768, - -32768, 158, 159,-32768,-32768,-32768, 183, 48, 49,-32768, - -32768, 76, 77, 186, 131, 163, 82, 92, 164, 166, - 187,-32768,-32768, 167, 168,-32768,-32768, 190,-32768,-32768, - 194, 195, 196, 197, 198, 199, 200,-32768, 206, 207, - -32768 -}; - -static const short yypgoto[] = -{ - -32768, 1, 165, -38, -47, 137,-32768,-32768,-32768 -}; - - -#define YYLAST 210 - - -static const short yytable[] = -{ - 63, 67, 12, 54, 55, 56, 60, 67, 36, 79, - 1, 67, 3, 37, 4, 77, 5, 6, 7, 70, - 73, 13, 73, 8, 9, 10, 73, 14, 68, 13, - 73, 57, 11, 38, 72, 39, 80, 74, 84, 74, - 28, 15, 16, 74, 17, 27, 75, 74, 78, 29, - 18, 19, 107, 108, 73, 73, 90, 111, 112, 71, - 36, 20, 116, 117, 3, 37, 4, 21, 5, 6, - 7, 74, 74, 22, 30, 8, 9, 10, 23, 31, - 114, 115, 73, 73, 11, 38, 36, 42, 73, 33, - 3, 37, 4, 35, 5, 6, 7, 44, 73, 74, - 74, 8, 9, 10, 45, 74, 46, 50, 118, 119, - 11, 38, 36, 43, 123, 74, 3, 37, 4, 47, - 5, 6, 7, 58, 124, 48, 59, 8, 9, 10, - 62, 87, 88, 65, 66, 69, 11, 38, 36, 49, - 85, 81, 3, 37, 4, 89, 5, 6, 7, 82, - 83, 94, 95, 8, 9, 10, 96, 91, 92, 97, - 2, 121, 11, 38, 3, 52, 4, 98, 5, 6, - 7, 93, 101, 102, 99, 8, 9, 10, 100, 25, - 26, 104, 106, 105, 11, 32, 103, 34, 113, 109, - 110, 120, 127, 122, 125, 130, 126, 128, 129, 131, - 132, 133, 134, 135, 136, 137, 139, 140, 0, 0, - 86 -}; - -static const short yycheck[] = -{ - 47, 5, 1, 3, 4, 5, 44, 5, 3, 5, - 26, 5, 7, 8, 9, 62, 11, 12, 13, 57, - 6, 29, 6, 18, 19, 20, 6, 29, 32, 29, - 6, 31, 27, 28, 32, 30, 32, 23, 32, 23, - 15, 29, 29, 23, 29, 14, 32, 23, 32, 24, - 29, 29, 99, 100, 6, 6, 32, 104, 105, 58, - 3, 29, 109, 110, 7, 8, 9, 29, 11, 12, - 13, 23, 23, 29, 15, 18, 19, 20, 25, 14, - 32, 32, 6, 6, 27, 28, 3, 30, 6, 21, - 7, 8, 9, 31, 11, 12, 13, 31, 6, 23, - 23, 18, 19, 20, 31, 23, 15, 5, 32, 32, - 27, 28, 3, 30, 32, 23, 7, 8, 9, 31, - 11, 12, 13, 3, 32, 31, 3, 18, 19, 20, - 31, 16, 17, 5, 30, 5, 27, 28, 3, 30, - 30, 5, 7, 8, 9, 30, 11, 12, 13, 5, - 5, 5, 30, 18, 19, 20, 5, 16, 17, 5, - 3, 30, 27, 28, 7, 30, 9, 5, 11, 12, - 13, 30, 16, 17, 31, 18, 19, 20, 31, 14, - 15, 31, 5, 31, 27, 20, 30, 22, 5, 31, - 31, 5, 5, 30, 30, 5, 30, 30, 30, 5, - 5, 5, 5, 5, 5, 5, 0, 0, -1, -1, - 73 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison/bison.simple" - -/* Skeleton output parser for bison, - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser when - the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free -# endif -#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short yyss; - YYSTYPE yyvs; -# if YYLSP_NEEDED - YYLTYPE yyls; -# endif -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# if YYLSP_NEEDED -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAX) -# else -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAX) -# endif - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - register YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror ("syntax error: cannot back up"); \ - YYERROR; \ - } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). - - When YYLLOC_DEFAULT is run, CURRENT is set the location of the - first token. By default, to implement support for ranges, extend - its range to the last symbol. */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#if YYPURE -# if YYLSP_NEEDED -# ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -# else -# define YYLEX yylex (&yylval, &yylloc) -# endif -# else /* !YYLSP_NEEDED */ -# ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -# else -# define YYLEX yylex (&yylval) -# endif -# endif /* !YYLSP_NEEDED */ -#else /* !YYPURE */ -# define YYLEX yylex () -#endif /* !YYPURE */ - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -#endif /* !YYDEBUG */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#if YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - -#ifdef YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - register const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - register char *yyd = yydest; - register const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif -#endif - -#line 315 "/usr/share/bison/bison.simple" - - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -# define YYPARSE_PARAM_DECL -# else -# define YYPARSE_PARAM_ARG YYPARSE_PARAM -# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -# endif -#else /* !YYPARSE_PARAM */ -# define YYPARSE_PARAM_ARG -# define YYPARSE_PARAM_DECL -#endif /* !YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -# ifdef YYPARSE_PARAM -int yyparse (void *); -# else -int yyparse (void); -# endif -#endif - -/* YY_DECL_VARIABLES -- depending whether we use a pure parser, - variables are global, or local to YYPARSE. */ - -#define YY_DECL_NON_LSP_VARIABLES \ -/* The lookahead symbol. */ \ -int yychar; \ - \ -/* The semantic value of the lookahead symbol. */ \ -YYSTYPE yylval; \ - \ -/* Number of parse errors so far. */ \ -int yynerrs; - -#if YYLSP_NEEDED -# define YY_DECL_VARIABLES \ -YY_DECL_NON_LSP_VARIABLES \ - \ -/* Location data for the lookahead symbol. */ \ -YYLTYPE yylloc; -#else -# define YY_DECL_VARIABLES \ -YY_DECL_NON_LSP_VARIABLES -#endif - - -/* If nonreentrant, generate the variables here. */ - -#if !YYPURE -YY_DECL_VARIABLES -#endif /* !YYPURE */ - -int -yyparse (YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - /* If reentrant, generate the variables here. */ -#if YYPURE - YY_DECL_VARIABLES -#endif /* !YYPURE */ - - register int yystate; - register int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ - int yychar1 = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; - -#if YYLSP_NEEDED - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; -#endif - -#if YYLSP_NEEDED -# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -# define YYPOPSTACK (yyvsp--, yyssp--) -#endif - - YYSIZE_T yystacksize = YYINITDEPTH; - - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; -#if YYLSP_NEEDED - YYLTYPE yyloc; -#endif - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; -#if YYLSP_NEEDED - yylsp = yyls; -#endif - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. */ -# if YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - yyls = yyls1; -# else - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); -# endif - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyoverflowlab; -# else - /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - goto yyoverflowlab; - yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; - - { - short *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyoverflowlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); -# if YYLSP_NEEDED - YYSTACK_RELOCATE (yyls); -# endif -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; -#if YYLSP_NEEDED - yylsp = yyls + yysize - 1; -#endif - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ - { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yychar1 = YYTRANSLATE (yychar); - -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables - which are defined only if `YYDEBUG' is set. */ - if (yydebug) - { - YYFPRINTF (stderr, "Next token is %d (%s", - yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise - meaning of a token, for further debugging info. */ -# ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -# endif - YYFPRINTF (stderr, ")\n"); - } -#endif - } - - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) - goto yydefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %d (%s), ", - yychar, yytname[yychar1])); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; -#if YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to the semantic value of - the lookahead token. This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - -#if YYLSP_NEEDED - /* Similarly for the default location. Let the user run additional - commands if for instance locations are ranges. */ - yyloc = yylsp[1-yylen]; - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); -#endif - -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables which - are defined only if `YYDEBUG' is set. */ - if (yydebug) - { - int yyi; - - YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - switch (yyn) { - -case 1: -#line 94 "parser.y" -{ root_node=yyvsp[0].nodo; ; - break;} -case 2: -#line 98 "parser.y" -{ yyval.nodo=new Material(yyvsp[-1].nodo); delete yyvsp[-1].nodo;; - break;} -case 3: -#line 99 "parser.y" -{ yyval.nodo=new Texture2(yyvsp[-1].nodo); delete yyvsp[-1].nodo;; - break;} -case 4: -#line 100 "parser.y" -{ yyval.nodo=new Coordinate3(yyvsp[-2].vlist); delete yyvsp[-2].vlist; ; - break;} -case 5: -#line 101 "parser.y" -{yyval.nodo=new IndexedFaceSet(yyvsp[-2].plist); delete yyvsp[-2].plist; ; - break;} -case 6: -#line 102 "parser.y" -{yyval.nodo=new IndexedFaceSet(yyvsp[-6].plist,yyvsp[-2].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; ; - break;} -case 7: -#line 103 "parser.y" -{yyval.nodo=new IndexedFaceSet(yyvsp[-6].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; ; - break;} -case 8: -#line 104 "parser.y" -{yyval.nodo=new IndexedFaceSet(yyvsp[-2].plist); delete yyvsp[-2].plist; yyval.nodo->setTwoSided(); ; - break;} -case 9: -#line 105 "parser.y" -{yyval.nodo=new IndexedFaceSet(yyvsp[-6].plist,yyvsp[-2].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; yyval.nodo->setTwoSided(); yyval.nodo->setTwoSided(); ; - break;} -case 10: -#line 106 "parser.y" -{yyval.nodo=new IndexedFaceSet(yyvsp[-6].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; yyval.nodo->setTwoSided(); ; - break;} -case 11: -#line 108 "parser.y" -{yyval.nodo=new IndexedTriStripSet(yyvsp[-2].plist); delete yyvsp[-2].plist; ; - break;} -case 12: -#line 109 "parser.y" -{yyval.nodo=new IndexedTriStripSet(yyvsp[-6].plist,yyvsp[-2].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; ; - break;} -case 13: -#line 110 "parser.y" -{yyval.nodo=new IndexedTriStripSet(yyvsp[-6].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; ; - break;} -case 14: -#line 111 "parser.y" -{ yyval.nodo=new MatrixTransform(yyvsp[-1].matrix); ; - break;} -case 15: -#line 112 "parser.y" -{ yyval.nodo=new TextureCoordinate(yyvsp[-2].tcoord); delete yyvsp[-2].tcoord; ; - break;} -case 16: -#line 113 "parser.y" -{ yyval.nodo=new Transform(yyvsp[-1].nodo); delete yyvsp[-1].nodo; ; - break;} -case 17: -#line 114 "parser.y" -{ yyval.nodo=yyvsp[-1].nodo; ; - break;} -case 18: -#line 115 "parser.y" -{yyval.nodo=new Separator(yyvsp[-1].nodo); delete yyvsp[-1].nodo; ; - break;} -case 19: -#line 118 "parser.y" -{ yyval.nodo=new MyNode(); ; - break;} -case 20: -#line 119 "parser.y" -{ yyvsp[-1].nodo->addAttribute(yyvsp[0].attribute->getName(), yyvsp[0].attribute); yyval.nodo=yyvsp[-1].nodo; ; - break;} -case 21: -#line 120 "parser.y" -{ NodeCache::addNode(yyvsp[-1].s_value,yyvsp[0].nodo); yyvsp[-3].nodo->addChild(yyvsp[0].nodo); yyval.nodo=yyvsp[-3].nodo; ; - break;} -case 22: -#line 121 "parser.y" -{ yyvsp[-1].nodo->addChild(yyvsp[0].nodo); yyval.nodo=yyvsp[-1].nodo; ; - break;} -case 23: -#line 122 "parser.y" -{yyvsp[-2].nodo->addChild(NodeCache::getNode(yyvsp[0].s_value)); yyval.nodo=yyvsp[-2].nodo; ; - break;} -case 24: -#line 123 "parser.y" -{ delete yyvsp[-1].vlist;yyval.nodo=new MyNode(); ; - break;} -case 25: -#line 126 "parser.y" -{ yyvsp[-3].vlist->push_back(osg::Vec3(yyvsp[-2].f_value,yyvsp[-1].f_value,yyvsp[0].f_value)); yyval.vlist=yyvsp[-3].vlist; ; - break;} -case 26: -#line 127 "parser.y" -{ yyval.vlist=new VertexList(); ; - break;} -case 27: -#line 130 "parser.y" -{ yyvsp[-1].plist->push_back(yyvsp[0].vindex);yyval.plist=yyvsp[-1].plist; ; - break;} -case 28: -#line 131 "parser.y" -{ yyval.plist=new PolygonList(); ; - break;} -case 29: -#line 134 "parser.y" -{ yyvsp[0].vindex->push_back(yyvsp[-1].i_value);yyval.vindex=yyvsp[0].vindex; ; - break;} -case 30: -#line 135 "parser.y" -{ yyval.vindex=new VertexIndexList(); ; - break;} -case 31: -#line 142 "parser.y" -{Matrix m; m[0]=yyvsp[-15].f_value; m[1]=yyvsp[-14].f_value; m[2]=yyvsp[-13].f_value;m[3]=yyvsp[-12].f_value;m[4]=yyvsp[-11].f_value;m[5]=yyvsp[-10].f_value;m[6]=yyvsp[-9].f_value;m[7]=yyvsp[-8].f_value;m[8]=yyvsp[-7].f_value;m[9]=yyvsp[-6].f_value;m[10]=yyvsp[-5].f_value;m[11]=yyvsp[-4].f_value;m[12]=yyvsp[-3].f_value;m[13]=yyvsp[-2].f_value;m[14]=yyvsp[-1].f_value;m[15]=yyvsp[0].f_value; memcpy(yyval.matrix,m,sizeof(m));; - break;} -case 32: -#line 146 "parser.y" -{ yyval.attribute=new AtrFloat(yyvsp[-1].s_value,yyvsp[0].f_value); ; - break;} -case 33: -#line 147 "parser.y" -{ yyval.attribute=new AtrString(yyvsp[-1].s_value,yyvsp[0].s_value); ; - break;} -case 34: -#line 148 "parser.y" -{ yyval.attribute=new AtrVec(yyvsp[-2].s_value,yyvsp[-1].f_value,yyvsp[0].f_value); ; - break;} -case 35: -#line 149 "parser.y" -{ yyval.attribute=new AtrVec(yyvsp[-3].s_value,yyvsp[-2].f_value,yyvsp[-1].f_value,yyvsp[0].f_value); ; - break;} -case 36: -#line 150 "parser.y" -{ yyval.attribute=new AtrVec(yyvsp[-4].s_value,yyvsp[-3].f_value,yyvsp[-2].f_value,yyvsp[-1].f_value,yyvsp[0].f_value); ; - break;} -case 37: -#line 151 "parser.y" -{ yyval.attribute=new AtrString(yyvsp[-1].s_value,yyvsp[0].s_value); ; - break;} -case 38: -#line 152 "parser.y" -{ yyval.attribute=new AtrVec3List(yyvsp[-3].s_value,yyvsp[-1].vlist); ; - break;} -case 39: -#line 155 "parser.y" -{ yyvsp[-2].tcoord->push_back(TextureCoordVal(yyvsp[-1].f_value,yyvsp[0].f_value));yyval.tcoord=yyvsp[-2].tcoord; ; - break;} -case 40: -#line 156 "parser.y" -{ yyval.tcoord=new TextureCoordList(); ; - break;} -} - -#line 705 "/usr/share/bison/bison.simple" - - - yyvsp -= yylen; - yyssp -= yylen; -#if YYLSP_NEEDED - yylsp -= yylen; -#endif - -#if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif - - *++yyvsp = yyval; -#if YYLSP_NEEDED - *++yylsp = yyloc; -#endif - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - char *yymsg; - int yyx, yycount; - - yycount = 0; - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx) - yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("parse error, unexpected ") + 1; - yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "parse error, unexpected "); - yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); - - if (yycount < 5) - { - yycount = 0; - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); - yyx++) - if (yycheck[yyx + yyn] == yyx) - { - const char *yyq = ! yycount ? ", expecting " : " or "; - yyp = yystpcpy (yyp, yyq); - yyp = yystpcpy (yyp, yytname[yyx]); - yycount++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - yyerror ("parse error; also virtual memory exhausted"); - } - else -#endif /* defined (YYERROR_VERBOSE) */ - yyerror ("parse error"); - } - goto yyerrlab1; - - -/*--------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action | -`--------------------------------------------------*/ -yyerrlab1: - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - YYDPRINTF ((stderr, "Discarding token %d (%s).\n", - yychar, yytname[yychar1])); - yychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - - -/*-------------------------------------------------------------------. -| yyerrdefault -- current state does not do anything special for the | -| error token. | -`-------------------------------------------------------------------*/ -yyerrdefault: -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - - /* If its default is to accept any token, ok. Otherwise pop it. */ - yyn = yydefact[yystate]; - if (yyn) - goto yydefault; -#endif - - -/*---------------------------------------------------------------. -| yyerrpop -- pop the current state because it cannot handle the | -| error token | -`---------------------------------------------------------------*/ -yyerrpop: - if (yyssp == yyss) - YYABORT; - yyvsp--; - yystate = *--yyssp; -#if YYLSP_NEEDED - yylsp--; -#endif - -#if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "Error: state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif - -/*--------------. -| yyerrhandle. | -`--------------*/ -yyerrhandle: - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - - YYDPRINTF ((stderr, "Shifting error token, ")); - - *++yyvsp = yylval; -#if YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -/*---------------------------------------------. -| yyoverflowab -- parser overflow comes here. | -`---------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); - yyresult = 2; - /* Fall through. */ - -yyreturn: -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} -#line 159 "parser.y" - - -void yyerror(char *str,...) -{ - printf("There was an error near line %d : \"%s\"!!!\n",yyline,str);fflush(stdout); -} - -MyNode *getRoot() { return root_node; } diff --git a/src/osgPlugins/iv/parser.hpp b/src/osgPlugins/iv/parser.hpp deleted file mode 100644 index 1f5f4ad1e..000000000 --- a/src/osgPlugins/iv/parser.hpp +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef BISON_PARSER_HPP -# define BISON_PARSER_HPP - -#ifndef YYSTYPE -typedef union { - char *s_value; - float f_value; - MyNode *nodo; - Attribute *attribute; - VertexList *vlist; - VertexIndexList *vindex; - TextureCoordList *tcoord; - PolygonList *plist; - Matrix matrix; - int i_value; -} yystype; -# define YYSTYPE yystype -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -# define STRING 257 -# define QUOTED_STRING 258 -# define FLOAT 259 -# define INT 260 -# define SEPARATOR 261 -# define DEF 262 -# define UN_MATERIAL 263 -# define DIFFUSE_COLOR 264 -# define COORDINATE3 265 -# define INDEXED_FACE_SET 266 -# define INDEXED_TRIANGLE_STRIP_SET 267 -# define A_POINT 268 -# define COORD_INDEX 269 -# define TEXTURE_COORD_INDEX 270 -# define NORMAL_INDEX 271 -# define TEXTURE_COORDINATE 272 -# define TEXTURE2 273 -# define MATRIX_TRANSFORM 274 -# define MATRIX 275 -# define LISTA_VACIA 276 -# define FINPOLY 277 -# define TWO_SIDED 278 -# define VECTOR 279 -# define VRML_HEADER 280 -# define TRANSFORM 281 -# define USE 282 - - -extern YYSTYPE yylval; - -#endif /* not BISON_PARSER_HPP */ diff --git a/src/osgPlugins/iv/parser.y b/src/osgPlugins/iv/parser.y deleted file mode 100644 index 2bdbf0dda..000000000 --- a/src/osgPlugins/iv/parser.y +++ /dev/null @@ -1,170 +0,0 @@ -%{ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef WIN32 -# pragma warning (disable:4786) -# pragma warning (disable:4541) -#endif - -// Where is malloc.h really needed? -#if !defined(__APPLE__) && !defined(macintosh) -#include -#endif - -#include "mynode.h" -#include -#include "geometry.h" -#include "nodecache.h" - -#include "material.h" -#include "coordinate3.h" -#include "separator.h" -#include "matrixtransform.h" -#include "indexedfaceset.h" -#include "indexedtristripset.h" -#include "texturecoordinate.h" -#include "texture2.h" -#include "transform.h" - -#include "atrfloat.h" -#include "atrstring.h" -#include "atrvec.h" -#include "atrvec3list.h" -#include "string.h" -extern int yyline; -extern int yylex(); -void yyerror(char *str,...); -static MyNode *root_node; - -%} - -%union { - char *s_value; - float f_value; - MyNode *nodo; - Attribute *attribute; - VertexList *vlist; - VertexIndexList *vindex; - TextureCoordList *tcoord; - PolygonList *plist; - Matrix matrix; - int i_value; -}; - -%token STRING -%token QUOTED_STRING -%token FLOAT -%token INT -%token SEPARATOR DEF UN_MATERIAL DIFFUSE_COLOR COORDINATE3 INDEXED_FACE_SET INDEXED_TRIANGLE_STRIP_SET -%token A_POINT COORD_INDEX TEXTURE_COORD_INDEX NORMAL_INDEX TEXTURE_COORDINATE TEXTURE2 -%token MATRIX_TRANSFORM MATRIX -%token LISTA_VACIA FINPOLY -%token TWO_SIDED -%token VECTOR -%token VRML_HEADER -%token TRANSFORM -%token USE - -%type points -%type polylist -%type vertexilist -%type coords -%type node_contents -%type node -%type attr -%type matrix -%start vrml_file - - -%% - -vrml_file: VRML_HEADER node { root_node=$2; } -; - -node: - UN_MATERIAL '{' node_contents '}' { $$=new Material($3); delete $3;} - | TEXTURE2 '{' node_contents '}' { $$=new Texture2($3); delete $3;} - | COORDINATE3 '{' A_POINT '[' points ']' '}' { $$=new Coordinate3($5); delete $5; } - | INDEXED_FACE_SET '{' COORD_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($5); delete $5; } - | INDEXED_FACE_SET '{' COORD_INDEX '[' polylist ']' TEXTURE_COORD_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($5,$9); delete $5; delete $9; } - | INDEXED_FACE_SET '{' COORD_INDEX '[' polylist ']' NORMAL_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($5); delete $5; delete $9; } - | INDEXED_FACE_SET '{' TWO_SIDED COORD_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($6); delete $6; $$->setTwoSided(); } - | INDEXED_FACE_SET '{' TWO_SIDED COORD_INDEX '[' polylist ']' TEXTURE_COORD_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($6,$10); delete $6; delete $10; $$->setTwoSided(); $$->setTwoSided(); } - | INDEXED_FACE_SET '{' TWO_SIDED COORD_INDEX '[' polylist ']' NORMAL_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($6); delete $6; delete $10; $$->setTwoSided(); } - - | INDEXED_TRIANGLE_STRIP_SET '{' COORD_INDEX '[' polylist ']' '}' {$$=new IndexedTriStripSet($5); delete $5; } - | INDEXED_TRIANGLE_STRIP_SET '{' COORD_INDEX '[' polylist ']' TEXTURE_COORD_INDEX '[' polylist ']' '}' {$$=new IndexedTriStripSet($5,$9); delete $5; delete $9; } - | INDEXED_TRIANGLE_STRIP_SET '{' COORD_INDEX '[' polylist ']' NORMAL_INDEX '[' polylist ']' '}' {$$=new IndexedTriStripSet($5); delete $5; delete $9; } - | MATRIX_TRANSFORM '{' MATRIX matrix '}' { $$=new MatrixTransform($4); } - | TEXTURE_COORDINATE '{' A_POINT '[' coords ']' '}' { $$=new TextureCoordinate($5); delete $5; } - | TRANSFORM '{' node_contents '}' { $$=new Transform($3); delete $3; } - | STRING '{' node_contents '}' { $$=$3; } - | SEPARATOR '{' node_contents '}' {$$=new Separator($3); delete $3; } -; - -node_contents: { $$=new MyNode(); } - | node_contents attr { $1->addAttribute($2->getName(), $2); $$=$1; } - | node_contents DEF STRING node { NodeCache::addNode($3,$4); $1->addChild($4); $$=$1; } - | node_contents node { $1->addChild($2); $$=$1; } - | node_contents USE STRING {$1->addChild(NodeCache::getNode($3)); $$=$1; } - | VECTOR '[' points ']' { delete $3;$$=new MyNode(); } -; - -points: points FLOAT FLOAT FLOAT { $1->push_back(osg::Vec3($2,$3,$4)); $$=$1; } - | { $$=new VertexList(); } -; - -polylist: polylist vertexilist { $1->push_back($2);$$=$1; } - | { $$=new PolygonList(); } -; - -vertexilist: INT vertexilist { $2->push_back($1);$$=$2; } - | FINPOLY { $$=new VertexIndexList(); } -; - -matrix: - FLOAT FLOAT FLOAT FLOAT - FLOAT FLOAT FLOAT FLOAT - FLOAT FLOAT FLOAT FLOAT - FLOAT FLOAT FLOAT FLOAT {Matrix m; m[0]=$1; m[1]=$2; m[2]=$3;m[3]=$4;m[4]=$5;m[5]=$6;m[6]=$7;m[7]=$8;m[8]=$9;m[9]=$10;m[10]=$11;m[11]=$12;m[12]=$13;m[13]=$14;m[14]=$15;m[15]=$16; memcpy($$,m,sizeof(m));} - -; - -attr: STRING FLOAT { $$=new AtrFloat($1,$2); } - | STRING STRING { $$=new AtrString($1,$2); } - | STRING FLOAT FLOAT { $$=new AtrVec($1,$2,$3); } - | STRING FLOAT FLOAT FLOAT { $$=new AtrVec($1,$2,$3,$4); } - | STRING FLOAT FLOAT FLOAT FLOAT { $$=new AtrVec($1,$2,$3,$4,$5); } - | STRING QUOTED_STRING { $$=new AtrString($1,$2); } - | STRING '[' points ']' { $$=new AtrVec3List($1,$3); } -; - -coords: coords FLOAT FLOAT { $1->push_back(TextureCoordVal($2,$3));$$=$1; } - | { $$=new TextureCoordList(); } -; - -%% - -void yyerror(char *str,...) -{ - printf("There was an error near line %d : \"%s\"!!!\n",yyline,str);fflush(stdout); -} - -MyNode *getRoot() { return root_node; } diff --git a/src/osgPlugins/iv/readerwriter.cpp b/src/osgPlugins/iv/readerwriter.cpp deleted file mode 100644 index b6a491eec..000000000 --- a/src/osgPlugins/iv/readerwriter.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef WIN32 -# pragma warning (disable:4786) -# pragma warning (disable:4541) -#endif -#include "readerwriter.h" - -#include -#include - -#include - -#include "mynode.h" -#include "osgvisitor.h" - -extern int yyparse(); -extern int yydebug; -extern MyNode *getRoot(); -extern FILE *yyin; -int isatty(int) { return 0; } -extern void flush_scanner(); - - -osgDB::ReaderWriter::ReadResult VrmlReaderWriter::readNode(const std::string& fileName, - const osgDB::ReaderWriter::Options*) -{ - std::string ext = osgDB::getFileExtension(fileName); - if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED; - - yydebug=0; - yyin=fopen(fileName.c_str(),"r"); - osg::notify(osg::INFO) << "Parsing..." << std::endl; - if (yyparse()!=0) - { - flush_scanner(); - return ReadResult::FILE_NOT_HANDLED; - } - osg::ref_ptr n=getRoot(); - try - { - osg::notify(osg::INFO) << "Generating OSG tree..." << std::endl; - osg::ref_ptr visitante=new OSGVisitor(n.get()); - return visitante->getRoot(); - } - catch (...) - { - osg::notify(osg::INFO) << "VRML: error reading" << std::endl; - return ReadResult::ERROR_IN_READING_FILE; - } -} - -osgDB::RegisterReaderWriterProxy g_readerWriter_VRML_Proxy; diff --git a/src/osgPlugins/iv/readerwriter.h b/src/osgPlugins/iv/readerwriter.h deleted file mode 100644 index 3a754f16a..000000000 --- a/src/osgPlugins/iv/readerwriter.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LECTOR_ESCRITOR_H__ -#define __LECTOR_ESCRITOR_H__ - -#include -#include -#include -#include -#include - -class VrmlReaderWriter: public osgDB::ReaderWriter { -public: - VrmlReaderWriter() { } - virtual const char* className() { return "VRML"; } - virtual bool acceptsExtension(const std::string& extension) - { - return osgDB::equalCaseInsensitive(extension,"wrl") || - osgDB::equalCaseInsensitive(extension,"iv"); - } - virtual ReadResult readNode(const std::string& fileName,const osgDB::ReaderWriter::Options*); -}; - -#endif diff --git a/src/osgPlugins/iv/scanner.cpp b/src/osgPlugins/iv/scanner.cpp deleted file mode 100644 index f6babfc78..000000000 --- a/src/osgPlugins/iv/scanner.cpp +++ /dev/null @@ -1,2123 +0,0 @@ -#line 2 "scanner.cpp" -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header$ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include - -#if !defined(_MSC_VER) - #include -#endif - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 35 -#define YY_END_OF_BUFFER 36 -static yyconst short int yy_accept[254] = - { 0, - 33, 33, 0, 0, 33, 33, 36, 35, 1, 2, - 1, 33, 35, 25, 33, 1, 33, 29, 33, 33, - 33, 33, 33, 33, 33, 31, 21, 33, 33, 33, - 33, 33, 33, 31, 35, 30, 0, 0, 33, 0, - 34, 25, 25, 25, 33, 29, 26, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 32, 33, 33, - 33, 33, 33, 33, 30, 20, 25, 25, 26, 33, - 0, 33, 33, 3, 33, 33, 33, 33, 33, 33, - 22, 33, 33, 33, 33, 33, 33, 25, 25, 0, - 33, 28, 28, 33, 33, 33, 33, 33, 33, 33, - - 33, 33, 33, 33, 33, 33, 33, 25, 25, 27, - 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 15, 33, 33, 25, 25, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 14, 33, 33, 19, - 25, 25, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 25, 25, 33, 33, 33, 7, 33, - 33, 5, 33, 33, 13, 33, 33, 33, 25, 25, - 33, 33, 33, 33, 6, 33, 11, 33, 33, 33, - 25, 25, 33, 33, 33, 33, 33, 16, 33, 33, - 25, 25, 4, 33, 33, 33, 33, 18, 33, 25, - - 25, 33, 33, 33, 33, 33, 25, 25, 33, 33, - 33, 33, 33, 25, 0, 25, 8, 33, 33, 33, - 33, 25, 0, 25, 33, 12, 33, 33, 25, 0, - 23, 33, 33, 33, 25, 0, 33, 33, 17, 25, - 0, 33, 10, 25, 0, 33, 24, 24, 33, 33, - 33, 9, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 6, 7, 8, 1, 1, 1, 1, 1, - 1, 9, 10, 11, 12, 13, 1, 14, 15, 16, - 17, 18, 18, 18, 18, 18, 18, 1, 1, 1, - 1, 1, 1, 1, 9, 9, 19, 20, 21, 22, - 9, 9, 23, 9, 9, 24, 25, 9, 9, 9, - 9, 26, 27, 28, 29, 30, 9, 9, 9, 9, - 31, 1, 32, 1, 9, 1, 33, 9, 34, 35, - - 36, 37, 38, 9, 39, 9, 9, 40, 41, 42, - 43, 44, 9, 45, 46, 47, 48, 49, 50, 51, - 9, 9, 52, 1, 52, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[53] = - { 0, - 1, 1, 2, 3, 4, 5, 1, 1, 5, 1, - 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 4, 1, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 1 - } ; - -static yyconst short int yy_base[261] = - { 0, - 0, 0, 51, 102, 154, 206, 236, 1405, 1405, 1405, - 53, 0, 227, 34, 65, 1405, 254, 59, 68, 81, - 84, 116, 132, 138, 119, 187, 1405, 135, 166, 187, - 189, 216, 218, 1405, 225, 247, 54, 183, 0, 205, - 1405, 0, 163, 178, 122, 87, 259, 276, 278, 222, - 220, 287, 291, 293, 297, 306, 310, 1405, 320, 333, - 337, 342, 347, 352, 373, 378, 154, 176, 385, 65, - 393, 398, 412, 366, 414, 417, 423, 427, 429, 446, - 433, 462, 473, 475, 477, 479, 489, 162, 172, 482, - 497, 507, 513, 527, 529, 532, 542, 538, 544, 548, - - 559, 565, 580, 582, 596, 599, 601, 149, 185, 606, - 619, 633, 635, 644, 646, 648, 657, 663, 679, 685, - 690, 699, 712, 714, 718, 142, 157, 723, 727, 742, - 729, 761, 763, 766, 775, 772, 785, 799, 812, 814, - 141, 167, 818, 828, 823, 833, 852, 855, 867, 871, - 876, 886, 891, 136, 167, 888, 903, 908, 918, 924, - 920, 935, 937, 941, 939, 954, 956, 958, 172, 162, - 968, 971, 987, 990, 1002, 1004, 1006, 1017, 1023, 1033, - 145, 168, 1036, 1038, 1050, 1060, 1065, 1074, 1080, 1084, - 154, 134, 1089, 1094, 1103, 1113, 1117, 1122, 1127, 147, - - 106, 1133, 1136, 1150, 1155, 1160, 138, 105, 1165, 1171, - 1174, 1184, 1193, 131, 126, 91, 1203, 1208, 1212, 1217, - 1223, 77, 76, 62, 1232, 1236, 1251, 1255, 52, 47, - 0, 1264, 1266, 1268, 58, 57, 1270, 1287, 1283, 49, - 40, 1299, 1303, 37, 22, 1315, 0, 1405, 1318, 1320, - 1330, 1334, 1405, 1377, 1382, 55, 1387, 1392, 1394, 1399 - } ; - -static yyconst short int yy_def[261] = - { 0, - 253, 1, 254, 254, 255, 255, 253, 253, 253, 253, - 253, 256, 257, 258, 259, 253, 259, 17, 259, 259, - 259, 259, 259, 259, 259, 253, 253, 259, 259, 259, - 259, 259, 259, 253, 253, 253, 253, 253, 256, 257, - 253, 258, 258, 258, 259, 17, 256, 259, 259, 259, - 259, 259, 259, 259, 259, 259, 259, 253, 259, 259, - 259, 259, 259, 259, 253, 253, 258, 258, 256, 256, - 253, 17, 259, 259, 259, 259, 259, 259, 259, 259, - 259, 259, 259, 259, 259, 259, 259, 258, 258, 253, - 256, 253, 17, 259, 259, 259, 259, 259, 259, 259, - - 259, 259, 259, 259, 259, 259, 259, 258, 258, 253, - 256, 259, 259, 259, 259, 259, 259, 259, 259, 259, - 259, 259, 259, 259, 259, 258, 258, 259, 259, 259, - 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, - 258, 258, 259, 259, 259, 259, 259, 259, 259, 259, - 259, 259, 259, 258, 258, 259, 259, 259, 259, 259, - 259, 259, 259, 259, 259, 259, 259, 259, 258, 258, - 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, - 258, 258, 259, 259, 259, 259, 259, 259, 259, 259, - 258, 258, 259, 259, 259, 259, 259, 259, 259, 258, - - 258, 259, 259, 259, 259, 259, 260, 258, 259, 259, - 259, 259, 259, 258, 253, 258, 259, 259, 259, 259, - 259, 258, 253, 258, 259, 259, 259, 259, 258, 253, - 258, 259, 259, 259, 258, 253, 259, 259, 259, 258, - 253, 259, 259, 258, 253, 259, 258, 253, 259, 259, - 259, 259, 0, 253, 253, 253, 253, 253, 253, 253 - } ; - -static yyconst short int yy_nxt[1458] = - { 0, - 8, 9, 10, 9, 11, 12, 13, 14, 15, 8, - 16, 17, 12, 18, 18, 18, 18, 18, 19, 20, - 15, 15, 21, 15, 22, 15, 23, 24, 25, 15, - 26, 27, 15, 28, 15, 15, 15, 15, 15, 15, - 29, 30, 15, 31, 15, 15, 32, 15, 33, 15, - 15, 34, 9, 10, 9, 9, 43, 37, 37, 39, - 248, 16, 35, 44, 36, 36, 36, 36, 36, 37, - 39, 47, 37, 39, 90, 247, 91, 39, 245, 48, - 39, 34, 27, 38, 38, 37, 39, 244, 37, 39, - 241, 240, 236, 39, 48, 38, 39, 235, 38, 47, - - 231, 50, 34, 9, 10, 9, 9, 48, 230, 229, - 49, 38, 16, 35, 38, 36, 36, 36, 36, 36, - 37, 39, 48, 37, 39, 51, 37, 39, 39, 224, - 223, 39, 34, 27, 39, 222, 37, 39, 216, 37, - 39, 215, 37, 39, 39, 57, 38, 39, 52, 38, - 39, 208, 38, 34, 8, 8, 8, 8, 8, 207, - 8, 8, 38, 8, 8, 38, 201, 53, 38, 200, - 37, 39, 192, 54, 191, 182, 181, 59, 39, 170, - 169, 155, 55, 154, 8, 8, 142, 56, 141, 127, - 126, 37, 39, 37, 39, 109, 38, 108, 60, 39, - - 89, 39, 88, 68, 67, 8, 8, 8, 8, 8, - 8, 41, 8, 8, 58, 8, 8, 38, 58, 38, - 37, 39, 37, 39, 37, 39, 37, 39, 39, 61, - 39, 62, 39, 41, 39, 253, 8, 8, 65, 66, - 65, 65, 65, 74, 253, 253, 38, 253, 38, 253, - 38, 63, 38, 64, 75, 253, 253, 8, 37, 39, - 65, 65, 65, 65, 65, 253, 39, 46, 46, 46, - 46, 46, 69, 69, 69, 69, 69, 253, 253, 70, - 37, 39, 37, 39, 38, 71, 253, 72, 39, 253, - 39, 37, 39, 253, 70, 37, 39, 37, 39, 39, - - 253, 37, 39, 39, 253, 39, 38, 253, 38, 39, - 37, 39, 253, 253, 37, 39, 253, 38, 39, 253, - 73, 38, 39, 38, 37, 39, 253, 38, 253, 79, - 81, 253, 39, 76, 77, 253, 38, 37, 39, 253, - 38, 37, 39, 78, 253, 39, 37, 39, 80, 39, - 38, 37, 39, 253, 39, 253, 37, 39, 253, 39, - 253, 253, 82, 38, 39, 253, 253, 38, 253, 253, - 37, 39, 38, 253, 253, 253, 253, 38, 39, 83, - 85, 84, 38, 253, 253, 87, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 38, 86, 69, 69, - - 69, 69, 69, 253, 253, 70, 92, 92, 92, 92, - 92, 93, 93, 93, 93, 93, 37, 39, 37, 39, - 70, 37, 39, 253, 39, 253, 39, 37, 39, 39, - 253, 37, 39, 37, 39, 39, 253, 37, 39, 39, - 253, 39, 38, 253, 38, 39, 253, 38, 253, 95, - 37, 39, 96, 38, 253, 98, 94, 38, 39, 38, - 253, 97, 253, 38, 253, 253, 37, 39, 253, 253, - 100, 253, 101, 99, 39, 253, 38, 37, 39, 37, - 39, 37, 39, 37, 39, 39, 253, 39, 253, 39, - 253, 39, 38, 37, 39, 110, 110, 110, 110, 110, - - 253, 39, 253, 38, 253, 38, 102, 38, 253, 38, - 111, 111, 111, 111, 111, 104, 253, 103, 105, 38, - 92, 92, 92, 92, 92, 106, 93, 93, 93, 93, - 93, 37, 39, 37, 39, 107, 37, 39, 253, 39, - 253, 39, 37, 39, 39, 253, 37, 39, 37, 39, - 39, 253, 37, 39, 39, 253, 39, 38, 253, 38, - 39, 112, 38, 37, 39, 253, 253, 253, 38, 37, - 39, 39, 38, 253, 38, 253, 114, 39, 38, 113, - 115, 253, 116, 253, 37, 39, 37, 39, 253, 38, - 253, 117, 39, 118, 39, 38, 253, 119, 253, 120, - - 37, 39, 253, 37, 39, 37, 39, 253, 39, 253, - 38, 39, 38, 39, 122, 253, 253, 253, 121, 110, - 110, 110, 110, 110, 253, 253, 38, 253, 253, 38, - 253, 38, 111, 111, 111, 111, 111, 37, 39, 37, - 39, 253, 123, 125, 253, 39, 124, 39, 37, 39, - 37, 39, 37, 39, 253, 253, 39, 253, 39, 253, - 39, 37, 39, 38, 253, 38, 253, 37, 39, 39, - 129, 128, 253, 253, 38, 39, 38, 253, 38, 253, - 132, 253, 130, 37, 39, 253, 253, 38, 253, 37, - 39, 39, 253, 38, 37, 39, 131, 39, 253, 134, - - 253, 133, 39, 37, 39, 253, 253, 136, 253, 38, - 253, 39, 253, 135, 253, 38, 37, 39, 37, 39, - 38, 253, 37, 39, 39, 253, 39, 37, 39, 38, - 39, 37, 39, 37, 39, 39, 253, 253, 138, 39, - 137, 39, 38, 253, 38, 253, 37, 39, 38, 253, - 253, 253, 253, 38, 39, 253, 146, 38, 139, 38, - 253, 144, 140, 253, 143, 37, 39, 37, 39, 253, - 37, 39, 38, 39, 145, 39, 37, 39, 39, 37, - 39, 253, 253, 253, 39, 253, 253, 39, 253, 37, - 39, 38, 253, 38, 253, 253, 38, 39, 148, 253, - - 253, 253, 38, 37, 39, 38, 253, 147, 149, 253, - 150, 39, 253, 151, 253, 38, 37, 39, 37, 39, - 253, 152, 37, 39, 39, 253, 39, 37, 39, 38, - 39, 253, 37, 39, 253, 39, 253, 37, 39, 253, - 39, 253, 38, 253, 38, 39, 253, 153, 38, 157, - 156, 253, 253, 38, 253, 158, 37, 39, 38, 37, - 39, 253, 159, 38, 39, 253, 253, 39, 253, 253, - 162, 37, 39, 163, 253, 37, 39, 160, 253, 39, - 37, 39, 38, 39, 253, 38, 253, 253, 39, 253, - 37, 39, 37, 39, 161, 37, 39, 38, 39, 253, - - 39, 38, 253, 39, 253, 165, 38, 37, 39, 168, - 166, 164, 37, 39, 253, 39, 38, 253, 38, 253, - 39, 38, 37, 39, 37, 39, 253, 167, 37, 39, - 39, 253, 39, 38, 171, 172, 39, 253, 38, 37, - 39, 37, 39, 37, 39, 37, 39, 39, 38, 39, - 38, 39, 173, 39, 38, 253, 174, 253, 37, 39, - 37, 39, 37, 39, 175, 38, 39, 38, 39, 38, - 39, 38, 37, 39, 253, 37, 39, 253, 253, 176, - 39, 177, 253, 39, 38, 253, 38, 253, 38, 178, - 179, 37, 39, 253, 37, 39, 253, 253, 38, 39, - - 180, 38, 39, 183, 184, 253, 37, 39, 37, 39, - 37, 39, 253, 253, 39, 253, 39, 38, 39, 253, - 38, 37, 39, 253, 253, 185, 253, 37, 39, 39, - 253, 186, 38, 253, 38, 39, 38, 37, 39, 253, - 37, 39, 37, 39, 253, 39, 187, 38, 39, 253, - 39, 253, 193, 38, 37, 39, 253, 253, 189, 253, - 253, 253, 39, 38, 37, 39, 38, 188, 38, 37, - 39, 253, 39, 194, 253, 190, 253, 39, 37, 39, - 38, 253, 195, 253, 37, 39, 39, 253, 37, 39, - 38, 253, 39, 37, 39, 38, 39, 253, 37, 39, - - 253, 39, 253, 253, 38, 196, 39, 37, 39, 197, - 38, 253, 253, 253, 38, 39, 253, 37, 39, 38, - 202, 37, 39, 253, 38, 39, 37, 39, 199, 39, - 198, 37, 39, 38, 39, 253, 253, 37, 39, 39, - 37, 39, 253, 38, 203, 39, 253, 38, 39, 204, - 253, 205, 38, 253, 37, 39, 253, 38, 253, 37, - 39, 206, 39, 38, 37, 39, 38, 39, 209, 37, - 39, 253, 39, 210, 253, 37, 39, 39, 37, 39, - 38, 253, 213, 39, 253, 38, 39, 253, 37, 39, - 38, 253, 211, 212, 253, 38, 39, 37, 39, 253, - - 253, 38, 253, 253, 38, 39, 253, 37, 39, 253, - 218, 217, 37, 39, 38, 39, 37, 39, 219, 253, - 39, 37, 39, 38, 39, 220, 253, 37, 39, 39, - 253, 253, 253, 38, 221, 39, 37, 39, 38, 253, - 37, 39, 38, 225, 39, 253, 253, 38, 39, 227, - 253, 253, 226, 38, 253, 37, 39, 228, 232, 37, - 39, 253, 38, 39, 253, 253, 38, 39, 37, 39, - 37, 39, 37, 39, 37, 39, 39, 253, 39, 253, - 39, 38, 39, 253, 253, 38, 253, 37, 39, 253, - 234, 37, 39, 253, 38, 39, 38, 233, 38, 39, - - 38, 238, 243, 37, 39, 253, 253, 37, 39, 253, - 237, 39, 253, 38, 242, 39, 253, 38, 239, 37, - 39, 253, 37, 39, 37, 39, 253, 39, 253, 38, - 39, 253, 39, 38, 37, 39, 253, 246, 37, 39, - 253, 253, 39, 253, 250, 38, 39, 253, 38, 253, - 38, 253, 253, 253, 253, 251, 253, 253, 249, 253, - 38, 253, 253, 253, 38, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 252, 8, 8, 8, - 8, 8, 12, 12, 12, 12, 12, 40, 40, 40, - 40, 40, 42, 253, 253, 42, 42, 45, 45, 214, - - 253, 214, 214, 214, 7, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 253 - } ; - -static yyconst short int yy_chk[1458] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 3, 3, 3, 14, 11, 37, 256, - 245, 3, 3, 14, 3, 3, 3, 3, 3, 15, - 15, 18, 19, 19, 70, 244, 70, 15, 241, 18, - 19, 3, 3, 11, 37, 20, 20, 240, 21, 21, - 236, 235, 230, 20, 18, 15, 21, 229, 19, 46, - - 224, 20, 3, 4, 4, 4, 4, 46, 223, 222, - 19, 20, 4, 4, 21, 4, 4, 4, 4, 4, - 22, 22, 46, 25, 25, 21, 45, 45, 22, 216, - 215, 25, 4, 4, 45, 214, 23, 23, 208, 28, - 28, 207, 24, 24, 23, 25, 22, 28, 22, 25, - 24, 201, 45, 4, 5, 5, 5, 5, 5, 200, - 5, 5, 23, 5, 5, 28, 192, 23, 24, 191, - 29, 29, 182, 24, 181, 170, 169, 28, 29, 155, - 154, 142, 24, 141, 5, 5, 127, 24, 126, 109, - 108, 30, 30, 31, 31, 89, 29, 88, 29, 30, - - 68, 31, 67, 44, 43, 5, 6, 6, 6, 6, - 6, 40, 6, 6, 38, 6, 6, 30, 26, 31, - 32, 32, 33, 33, 51, 51, 50, 50, 32, 30, - 33, 31, 51, 13, 50, 7, 6, 6, 35, 35, - 35, 35, 35, 50, 0, 0, 32, 0, 33, 0, - 51, 32, 50, 33, 51, 0, 0, 6, 17, 17, - 36, 36, 36, 36, 36, 0, 17, 17, 17, 17, - 17, 17, 47, 47, 47, 47, 47, 0, 0, 47, - 48, 48, 49, 49, 17, 48, 0, 48, 48, 0, - 49, 52, 52, 0, 47, 53, 53, 54, 54, 52, - - 0, 55, 55, 53, 0, 54, 48, 0, 49, 55, - 56, 56, 0, 0, 57, 57, 0, 52, 56, 0, - 49, 53, 57, 54, 59, 59, 0, 55, 0, 55, - 57, 0, 59, 52, 53, 0, 56, 60, 60, 0, - 57, 61, 61, 54, 0, 60, 62, 62, 56, 61, - 59, 63, 63, 0, 62, 0, 64, 64, 0, 63, - 0, 0, 59, 60, 64, 0, 0, 61, 0, 0, - 74, 74, 62, 0, 0, 0, 0, 63, 74, 60, - 62, 61, 64, 0, 0, 64, 65, 65, 65, 65, - 65, 66, 66, 66, 66, 66, 74, 63, 69, 69, - - 69, 69, 69, 0, 0, 69, 71, 71, 71, 71, - 71, 72, 72, 72, 72, 72, 73, 73, 75, 75, - 69, 76, 76, 0, 73, 0, 75, 77, 77, 76, - 0, 78, 78, 79, 79, 77, 0, 81, 81, 78, - 0, 79, 73, 0, 75, 81, 0, 76, 0, 75, - 80, 80, 76, 77, 0, 77, 73, 78, 80, 79, - 0, 76, 0, 81, 0, 0, 82, 82, 0, 0, - 79, 0, 80, 78, 82, 0, 80, 83, 83, 84, - 84, 85, 85, 86, 86, 83, 0, 84, 0, 85, - 0, 86, 82, 87, 87, 90, 90, 90, 90, 90, - - 0, 87, 0, 83, 0, 84, 82, 85, 0, 86, - 91, 91, 91, 91, 91, 84, 0, 83, 85, 87, - 92, 92, 92, 92, 92, 86, 93, 93, 93, 93, - 93, 94, 94, 95, 95, 87, 96, 96, 0, 94, - 0, 95, 98, 98, 96, 0, 97, 97, 99, 99, - 98, 0, 100, 100, 97, 0, 99, 94, 0, 95, - 100, 94, 96, 101, 101, 0, 0, 0, 98, 102, - 102, 101, 97, 0, 99, 0, 96, 102, 100, 95, - 97, 0, 98, 0, 103, 103, 104, 104, 0, 101, - 0, 99, 103, 100, 104, 102, 0, 101, 0, 102, - - 105, 105, 0, 106, 106, 107, 107, 0, 105, 0, - 103, 106, 104, 107, 104, 0, 0, 0, 103, 110, - 110, 110, 110, 110, 0, 0, 105, 0, 0, 106, - 0, 107, 111, 111, 111, 111, 111, 112, 112, 113, - 113, 0, 105, 107, 0, 112, 106, 113, 114, 114, - 115, 115, 116, 116, 0, 0, 114, 0, 115, 0, - 116, 117, 117, 112, 0, 113, 0, 118, 118, 117, - 113, 112, 0, 0, 114, 118, 115, 0, 116, 0, - 116, 0, 114, 119, 119, 0, 0, 117, 0, 120, - 120, 119, 0, 118, 121, 121, 115, 120, 0, 118, - - 0, 117, 121, 122, 122, 0, 0, 120, 0, 119, - 0, 122, 0, 119, 0, 120, 123, 123, 124, 124, - 121, 0, 125, 125, 123, 0, 124, 128, 128, 122, - 125, 129, 129, 131, 131, 128, 0, 0, 122, 129, - 121, 131, 123, 0, 124, 0, 130, 130, 125, 0, - 0, 0, 0, 128, 130, 0, 131, 129, 124, 131, - 0, 129, 125, 0, 128, 132, 132, 133, 133, 0, - 134, 134, 130, 132, 130, 133, 136, 136, 134, 135, - 135, 0, 0, 0, 136, 0, 0, 135, 0, 137, - 137, 132, 0, 133, 0, 0, 134, 137, 133, 0, - - 0, 0, 136, 138, 138, 135, 0, 132, 134, 0, - 135, 138, 0, 136, 0, 137, 139, 139, 140, 140, - 0, 138, 143, 143, 139, 0, 140, 145, 145, 138, - 143, 0, 144, 144, 0, 145, 0, 146, 146, 0, - 144, 0, 139, 0, 140, 146, 0, 139, 143, 144, - 143, 0, 0, 145, 0, 144, 147, 147, 144, 148, - 148, 0, 145, 146, 147, 0, 0, 148, 0, 0, - 148, 149, 149, 148, 0, 150, 150, 146, 0, 149, - 151, 151, 147, 150, 0, 148, 0, 0, 151, 0, - 152, 152, 156, 156, 147, 153, 153, 149, 152, 0, - - 156, 150, 0, 153, 0, 150, 151, 157, 157, 153, - 151, 149, 158, 158, 0, 157, 152, 0, 156, 0, - 158, 153, 159, 159, 161, 161, 0, 152, 160, 160, - 159, 0, 161, 157, 156, 157, 160, 0, 158, 162, - 162, 163, 163, 165, 165, 164, 164, 162, 159, 163, - 161, 165, 158, 164, 160, 0, 160, 0, 166, 166, - 167, 167, 168, 168, 161, 162, 166, 163, 167, 165, - 168, 164, 171, 171, 0, 172, 172, 0, 0, 163, - 171, 164, 0, 172, 166, 0, 167, 0, 168, 166, - 167, 173, 173, 0, 174, 174, 0, 0, 171, 173, - - 168, 172, 174, 171, 172, 0, 175, 175, 176, 176, - 177, 177, 0, 0, 175, 0, 176, 173, 177, 0, - 174, 178, 178, 0, 0, 173, 0, 179, 179, 178, - 0, 174, 175, 0, 176, 179, 177, 180, 180, 0, - 183, 183, 184, 184, 0, 180, 176, 178, 183, 0, - 184, 0, 183, 179, 185, 185, 0, 0, 179, 0, - 0, 0, 185, 180, 186, 186, 183, 178, 184, 187, - 187, 0, 186, 184, 0, 180, 0, 187, 188, 188, - 185, 0, 185, 0, 189, 189, 188, 0, 190, 190, - 186, 0, 189, 193, 193, 187, 190, 0, 194, 194, - - 0, 193, 0, 0, 188, 186, 194, 195, 195, 187, - 189, 0, 0, 0, 190, 195, 0, 196, 196, 193, - 194, 197, 197, 0, 194, 196, 198, 198, 190, 197, - 189, 199, 199, 195, 198, 0, 0, 202, 202, 199, - 203, 203, 0, 196, 195, 202, 0, 197, 203, 196, - 0, 197, 198, 0, 204, 204, 0, 199, 0, 205, - 205, 199, 204, 202, 206, 206, 203, 205, 202, 209, - 209, 0, 206, 203, 0, 210, 210, 209, 211, 211, - 204, 0, 206, 210, 0, 205, 211, 0, 212, 212, - 206, 0, 204, 205, 0, 209, 212, 213, 213, 0, - - 0, 210, 0, 0, 211, 213, 0, 217, 217, 0, - 210, 209, 218, 218, 212, 217, 219, 219, 211, 0, - 218, 220, 220, 213, 219, 212, 0, 221, 221, 220, - 0, 0, 0, 217, 213, 221, 225, 225, 218, 0, - 226, 226, 219, 218, 225, 0, 0, 220, 226, 220, - 0, 0, 219, 221, 0, 227, 227, 221, 225, 228, - 228, 0, 225, 227, 0, 0, 226, 228, 232, 232, - 233, 233, 234, 234, 237, 237, 232, 0, 233, 0, - 234, 227, 237, 0, 0, 228, 0, 239, 239, 0, - 228, 238, 238, 0, 232, 239, 233, 227, 234, 238, - - 237, 233, 238, 242, 242, 0, 0, 243, 243, 0, - 232, 242, 0, 239, 237, 243, 0, 238, 234, 246, - 246, 0, 249, 249, 250, 250, 0, 246, 0, 242, - 249, 0, 250, 243, 251, 251, 0, 242, 252, 252, - 0, 0, 251, 0, 249, 246, 252, 0, 249, 0, - 250, 0, 0, 0, 0, 250, 0, 0, 246, 0, - 251, 0, 0, 0, 252, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 251, 254, 254, 254, - 254, 254, 255, 255, 255, 255, 255, 257, 257, 257, - 257, 257, 258, 0, 0, 258, 258, 259, 259, 260, - - 0, 260, 260, 260, 253, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 253 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "scanner.l" -#define INITIAL 0 -#line 2 "scanner.l" -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include "mynode.h" -#include "geometry.h" -#include "parser.hpp" -#include -int yyline=1; -#define cindex 1 - -#define def 2 - -#line 798 "scanner.cpp" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp=NULL, *yy_bp=NULL; - register int yy_act; - -#line 30 "scanner.l" - -#line 962 "scanner.cpp" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 254 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 1405 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 31 "scanner.l" - - YY_BREAK -case 2: -YY_RULE_SETUP -#line 32 "scanner.l" -{ yyline++; } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 33 "scanner.l" -{ BEGIN def;return DEF; } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 34 "scanner.l" -{ return COORDINATE3; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 35 "scanner.l" -{ return TEXTURE2; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 36 "scanner.l" -{ return SEPARATOR; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 37 "scanner.l" -{ return UN_MATERIAL; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 38 "scanner.l" -{ return INDEXED_FACE_SET; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 39 "scanner.l" -{ return INDEXED_TRIANGLE_STRIP_SET; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 40 "scanner.l" -{ return TEXTURE_COORDINATE; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 41 "scanner.l" -{ return TRANSFORM; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 42 "scanner.l" -{ return MATRIX_TRANSFORM; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 43 "scanner.l" -{ return TWO_SIDED; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 44 "scanner.l" -{ return MATRIX; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 45 "scanner.l" -{ return A_POINT; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 46 "scanner.l" -{ BEGIN cindex;return COORD_INDEX; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 47 "scanner.l" -{ BEGIN cindex;return TEXTURE_COORD_INDEX; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 48 "scanner.l" -{ BEGIN cindex;return NORMAL_INDEX; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 49 "scanner.l" -{ return VECTOR; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 50 "scanner.l" -{ return FINPOLY; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 51 "scanner.l" -{ BEGIN INITIAL; return ']'; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 52 "scanner.l" -{ BEGIN def;return USE; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 53 "scanner.l" -{ return VRML_HEADER; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 54 "scanner.l" -{ return VRML_HEADER; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 55 "scanner.l" - - YY_BREAK -case 26: -YY_RULE_SETUP -#line 56 "scanner.l" -{ - yylval.f_value=strtod(yytext,NULL); - return FLOAT; -} - YY_BREAK -case 27: -YY_RULE_SETUP -#line 60 "scanner.l" -{ - yylval.f_value=strtod(yytext,NULL); - return FLOAT; -} - YY_BREAK -case 28: -YY_RULE_SETUP -#line 64 "scanner.l" -{ - yylval.f_value=strtod(yytext,NULL); - return FLOAT; -} - YY_BREAK -case 29: -YY_RULE_SETUP -#line 68 "scanner.l" -{ - yylval.f_value=(float)strtol(yytext,NULL,10); - return FLOAT; -} - YY_BREAK -case 30: -YY_RULE_SETUP -#line 72 "scanner.l" -{ - yylval.i_value=strtol(yytext,NULL,10); - return INT; -} - YY_BREAK -case 31: -YY_RULE_SETUP -#line 76 "scanner.l" -{ return yytext[0]; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 77 "scanner.l" - - YY_BREAK -case 33: -YY_RULE_SETUP -#line 78 "scanner.l" -{ BEGIN INITIAL;yylval.s_value=strdup(yytext);return STRING; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 79 "scanner.l" -{ yylval.s_value=strdup(yytext+1);yylval.s_value[strlen(yylval.s_value)-1]=0;return QUOTED_STRING; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 81 "scanner.l" -ECHO; - YY_BREAK -#line 1235 "scanner.cpp" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(cindex): -case YY_STATE_EOF(def): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 254 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 254 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 253); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 81 "scanner.l" - - -int yywrap(void) -{ -return (1); -} - -void flush_scanner(void) { - yy_flush_buffer(YY_CURRENT_BUFFER); - -} diff --git a/src/osgPlugins/iv/scanner.l b/src/osgPlugins/iv/scanner.l deleted file mode 100644 index b5da303d8..000000000 --- a/src/osgPlugins/iv/scanner.l +++ /dev/null @@ -1,91 +0,0 @@ -%{ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include "mynode.h" -#include "geometry.h" -#include "parser.hpp" -#include -int yyline=1; -%} - -DIGIT [0-9] -%x cindex -%x def -%% -[ \t\r,] -"\n" { yyline++; } -DEF { BEGIN def;return DEF; } -Coordinate3 { return COORDINATE3; } -Texture2 { return TEXTURE2; } -Separator { return SEPARATOR; } -Material { return UN_MATERIAL; } -IndexedFaceSet { return INDEXED_FACE_SET; } -IndexedTriangleStripSet { return INDEXED_TRIANGLE_STRIP_SET; } -TextureCoordinate2 { return TEXTURE_COORDINATE; } -Transform { return TRANSFORM; } -MatrixTransform { return MATRIX_TRANSFORM; } -TwoSided { return TWO_SIDED; } -matrix { return MATRIX; } -point { return A_POINT; } -coordIndex { BEGIN cindex;return COORD_INDEX; } -textureCoordIndex { BEGIN cindex;return TEXTURE_COORD_INDEX; } -normalIndex { BEGIN cindex;return NORMAL_INDEX; } -vector { return VECTOR; } --1 { return FINPOLY; } -\] { BEGIN INITIAL; return ']'; } -USE { BEGIN def;return USE; } -"#VRML\ V1.0 ascii" { return VRML_HEADER; } -"#Inventor\ V2."." ascii" { return VRML_HEADER; } -#[^\n\r]* -"-"?{DIGIT}+"."{DIGIT}* { - yylval.f_value=strtod(yytext,NULL); - return FLOAT; -} -"-"?{DIGIT}+"."{DIGIT}*[Ee][\+-]{DIGIT}+ { - yylval.f_value=strtod(yytext,NULL); - return FLOAT; -} -"-"?{DIGIT}+[Ee][\+-]{DIGIT}+ { - yylval.f_value=strtod(yytext,NULL); - return FLOAT; -} -"-"?{DIGIT}+ { - yylval.f_value=(float)strtol(yytext,NULL,10); - return FLOAT; -} -"-"?{DIGIT}+ { - yylval.i_value=strtol(yytext,NULL,10); - return INT; -} -[,{}\[\]] { return yytext[0]; } -[a-zA-Z0-9\-\_\*]*\ *\[\] -[a-zA-Z0-9\-\_\*\!\.]* { BEGIN INITIAL;yylval.s_value=strdup(yytext);return STRING; } -\"[^\"]*\" { yylval.s_value=strdup(yytext+1);yylval.s_value[strlen(yylval.s_value)-1]=0;return QUOTED_STRING; } - -%% - -int yywrap(void) -{ -return (1); -} - -void flush_scanner(void) { - yy_flush_buffer(YY_CURRENT_BUFFER); - -} diff --git a/src/osgPlugins/iv/separator.h b/src/osgPlugins/iv/separator.h deleted file mode 100644 index 509d51762..000000000 --- a/src/osgPlugins/iv/separator.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __SEPARATOR_H__ -#define __SEPARATOR_H__ - -#include "mynode.h" - -class Separator: public MyNode { -public: - Separator() {} - Separator(MyNode *n): MyNode(n) {} - virtual char *type() { return "Separator"; } - virtual void accept(MyNodeVisitor *v) { v->applySeparator(this); } -}; - -#endif diff --git a/src/osgPlugins/iv/texture2.h b/src/osgPlugins/iv/texture2.h deleted file mode 100644 index 2a52015b9..000000000 --- a/src/osgPlugins/iv/texture2.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TEXTURE2_H__ -#define __TEXTURE2_H__ - -#include "mynode.h" - -class Texture2: public MyNode { -public: - Texture2() {} - Texture2(MyNode *n): MyNode(n) {} - virtual char *type() { return "Texture2"; } - virtual void accept(MyNodeVisitor *v) { v->applyTexture2(this); } -}; - -#endif diff --git a/src/osgPlugins/iv/texturecoordinate.h b/src/osgPlugins/iv/texturecoordinate.h deleted file mode 100644 index 434e1dae8..000000000 --- a/src/osgPlugins/iv/texturecoordinate.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TEXTURE_COORDINATE_H__ -#define __TEXTURE_COORDINATE_H__ - -#include "mynode.h" - -class TextureCoordinate: public MyNode { - TextureCoordList tcoords; -public: - TextureCoordinate() {} - TextureCoordinate(TextureCoordList *t) { - tcoords=*t; - } - virtual char *type() { return "TextureCoordinate"; } - virtual void accept(MyNodeVisitor *v) { v->applyTextureCoordinate(this); } - TextureCoordList getTextureCoords() { return tcoords; } -}; - -#endif diff --git a/src/osgPlugins/iv/transform.h b/src/osgPlugins/iv/transform.h deleted file mode 100644 index 1463ac1ff..000000000 --- a/src/osgPlugins/iv/transform.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph - * Copyright (C) 2002 Ruben Lopez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TRANSFORM_H__ -#define __TRANSFORM_H__ - -#include "mynode.h" - -class Transform: public MyNode { -public: - Transform() {} - Transform(MyNode *n): MyNode(n) {} - virtual char *type() { return "Transform"; } - virtual void accept(MyNodeVisitor *v) { v->applyTransform(this); } -}; - -#endif