Types.hh 3.97 KB
Newer Older
Jan Möbius's avatar
 
Jan Möbius committed
1
2
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//=============================================================================
//
//                               OpenFlipper
//        Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
//                           www.openflipper.org
//
//-----------------------------------------------------------------------------
//
//                                License
//
//  OpenFlipper 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 3 of the License, or
//  (at your option) any later version.
//
//  OpenFlipper 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 OpenFlipper.  If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
//
//   $Revision$
//   $Author$
//   $Date$
//
//=============================================================================




//=============================================================================
//
//  Types
//
//=============================================================================

/**
 * \file Types.hh
 * This File contains the basic available datatypes in the Framework.
 */


#ifndef TYPES_HH
#define TYPES_HH

#include "GlobalDefines.hh"


//== Global Typedefs  =================================================================

/** \brief Field describing the type of Objects.
 *
 *  This is an enumerator defining the supported data types. To decide which object
 *  type an object has, get the dataType from it.
 */
enum DataType {
   /// Empty Objects (Should not be used)
   DATA_NONE            = 0 ,
   /// Items used for Grouping
   DATA_GROUP           = 1 ,
   /// Point based objects
   DATA_POINTS          = 1 << 1,
   /// PolyLine objects
   DATA_POLY_LINE       = 1 << 2,
   /// Triangle Mesh objects
   DATA_TRIANGLE_MESH   = 1 << 3,
   /// Poly Mesh Objects
   DATA_POLY_MESH       = 1 << 4,
   /// Volumetric objects
   DATA_VOLUME          = 1 << 5,
   /// BSpline objects
   DATA_BSPLINE_CURVE   = 1 << 6,
   /// BSpline Surface objects
   DATA_BSPLINE_SURFACE = 1 << 7,
   /// Skeletons
   DATA_SKELETON        = 1 << 8,
};

/// Datatype matching all available types
const DataType DATA_ALL = DataType( DATA_POINTS | DATA_TRIANGLE_MESH | DATA_POLY_MESH | DATA_VOLUME | DATA_POLY_LINE | DATA_BSPLINE_CURVE | DATA_BSPLINE_SURFACE);

//== INCLUDES =================================================================

#include "BaseObject.hh"
#include "GroupObject.hh"
#include "BaseObjectData.hh"
#include "MeshObjectT.hh"

#ifdef ENABLE_BSPLINESURFACE_SUPPORT
#include "BSplineSurface/BSplineSurfaceObject.hh"
#endif

//== TYPEDEFS =================================================================

/// Standard Type for 3d Vector used for scripting
typedef ACG::Vec3d Vector;
/// Standard Type for id Lists used for scripting
typedef std::vector< int > idList;
/// Standard Type for a 4x4 Matrix used for scripting
typedef ACG::Matrix4x4d Matrix4x4;

Q_DECLARE_METATYPE(idList);
Q_DECLARE_METATYPE(QVector< int >);
Q_DECLARE_METATYPE(Vector);
Q_DECLARE_METATYPE(Matrix4x4);

/// Vector Type containing the Data Objects
typedef std::vector<BaseObjectData*> DataContainer;

/// Typedef for a Meshobject containing a triangle mesh
typedef MeshObject< TriMesh , DATA_TRIANGLE_MESH > TriMeshObject;

/// Typedef for a Meshobject containing a poly mesh
typedef MeshObject< PolyMesh , DATA_POLY_MESH >    PolyMeshObject;

//== CLASS DEFINITION =========================================================

//=============================================================================
#endif // TYPES_HH defined
//=============================================================================