source: OGRE/trunk/ogrenew/Tools/MayaExport/shared/include/OgreMayaCommon.h @ 657

Revision 657, 2.3 KB checked in by mattausch, 19 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1/*
2============================================================================
3This source file is part of the Ogre-Maya Tools.
4Distributed as part of Ogre (Object-oriented Graphics Rendering Engine).
5Copyright (C) 2003 Fifty1 Software Inc., Bytelords
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; either version 2
10of the License, or (at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20or go to http://www.gnu.org/licenses/gpl.txt
21============================================================================
22*/
23#ifndef _OGREMAYA_COMMON_H_
24#define _OGREMAYA_COMMON_H_
25
26#if defined( _MSC_VER )
27// Turn off warnings generated by long std templates
28// This warns about truncation to 255 characters in debug/browse info
29#   pragma warning (disable : 4786)
30#endif
31
32namespace OgreMaya {
33
34    typedef float Real;
35
36    template <typename Iterator>
37    void deleteAll(Iterator it, Iterator end) {               
38        for(;it!=end; ++it)
39            delete *it;
40    }
41
42    template <typename Iterator>
43    bool listEqual(Iterator it1, Iterator it2, Iterator end1, Iterator end2) {       
44        bool eq = true;
45        while(eq && it1!=end1 && it2!=end2) {
46            eq = *it1 == *it2;
47            ++it1;
48            ++it2;
49        }       
50
51        return
52            eq && it1==end1 && it2==end2;
53    }
54
55
56    struct Vector3 {
57        Real x,y,z;
58
59        Vector3(): x(0), y(0), z(0) {}
60
61        bool operator ==(const Vector3& other) const {
62            return x==other.x && y==other.y && z==other.z;
63        }
64    };
65
66    struct ColourValue {
67        Real r,g,b,a;
68
69        ColourValue(): r(0), g(0), b(0), a(1) {}
70
71        bool operator ==(const ColourValue& other) const {
72            return r==other.r && g==other.g && b==other.b && a==other.a;
73        }
74    };
75
76}
77
78#endif
Note: See TracBrowser for help on using the repository browser.