3
// Copyright 1997 - 2001, Paul C. Gregory
5
// Contact: pgregory@aqsis.com
7
// This library is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU Lesser General Public
9
// License as published by the Free Software Foundation; either
10
// version 2.1 of the License, or (at your option) any later version.
12
// This library is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
// General Public License for more details.
17
// You should have received a copy of the GNU General Public
18
// License along with this library; if not, write to the Free Software
19
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
* \brief This dictionary can handle inline declaration as described in RiSpec V3.2
23
* \author Lionel J. Lacour (intuition01@online.fr)
26
#ifndef RI2RIB_DICTIONARY_H
27
#define RI2RIB_DICTIONARY_H 1
34
START_NAMESPACE( libri2rib )
36
enum EqTokenClass { CONSTANT, UNIFORM, VARYING, VERTEX, FACEVARYING };
37
enum EqTokenType { FLOAT, POINT, VECTOR, NORMAL, COLOR, STRING, MATRIX, HPOINT, INTEGER };
38
typedef unsigned int TqTokenId;
42
SqTokenEntry ( std::string n, EqTokenClass tc, EqTokenType tt, TqUint qt, TqBool inln )
43
: name( n ), tclass( tc ), ttype( tt ), in_line( inln ), quantity( qt )
55
void printClassType ();
63
std::vector<SqTokenEntry> te;
64
TqUint getTypeSize ( EqTokenType );
65
TqUint getQuantity ( TqTokenId );
66
void isValid ( TqTokenId );
73
TqTokenId addToken ( std::string n, EqTokenClass tc, EqTokenType tt, TqUint qnt = 1, TqBool inln = false );
74
TqTokenId getTokenId ( std::string n );
75
TqUint allocSize ( TqTokenId id, TqUint vertex, TqUint varying, TqUint uniform, TqUint facevarying = 0 );
76
EqTokenType getType ( TqTokenId id );
84
END_NAMESPACE( libri2rib )