File: used_types.h

package info (click to toggle)
meshlab 2020.09%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 45,132 kB
  • sloc: cpp: 400,238; ansic: 31,952; javascript: 1,578; sh: 387; yacc: 238; lex: 139; python: 86; makefile: 30
file content (125 lines) | stat: -rwxr-xr-x 5,640 bytes parent folder | download | duplicates (2)
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
125
/****************************************************************************
* VCGLib                                                            o o     *
* Visual and Computer Graphics Library                            o     o   *
*                                                                _   O  _   *
* Copyright(C) 2004-2016                                           \/)\/    *
* Visual Computing Lab                                            /\/|      *
* ISTI - Italian National Research Council                           |      *
*                                                                    \      *
* All rights reserved.                                                      *
*                                                                           *
* 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 of the License, 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 (http://www.gnu.org/licenses/gpl.txt)          *
* for more details.                                                         *
*                                                                           *
****************************************************************************/
#ifndef VCG_USED_TYPES_H
#define VCG_USED_TYPES_H

#include <vcg/space/point3.h>
#include <vcg/space/box3.h>
#include <vcg/space/color4.h>
#include <vcg/math/shot.h>
#include <vcg/space/texcoord2.h>
#include <vcg/space/triangle3.h>
#include <vcg/space/polygon3.h>
#include <vcg/space/tetra3.h>

#include <vcg/container/derivation_chain.h>
#include <vcg/complex/all_types.h>
#include <vcg/simplex/vertex/component.h>
#include <vcg/simplex/vertex/component_ocf.h>
#include <vcg/simplex/vertex/base.h>
#include <vcg/simplex/face/component.h>
#include <vcg/simplex/face/component_ocf.h>
#include <vcg/simplex/face/component_polygon.h>
#include <vcg/simplex/face/base.h>
#include <vcg/simplex/edge/component.h>
#include <vcg/simplex/edge/base.h>
#include <vcg/simplex/tetrahedron/component.h>
#include <vcg/simplex/tetrahedron/base.h>
#include <vcg/connectors/hedge_component.h>
#include <vcg/connectors/hedge.h>

namespace vcg{

// dummy mesh

struct _Vertex;
struct _Edge  ;
struct _Face  ;
struct _Tetra ;
struct _HEdge ;

struct DummyTypes{
        typedef _Vertex VertexType; 		// simplex types
        typedef _Edge EdgeType;
        typedef _Face FaceType;
        typedef _Tetra TetraType;
        typedef _HEdge HEdgeType; 		// connector types

        typedef vcg::Point3<bool> CoordType;
        typedef char ScalarType;

        typedef VertexType * VertexPointer;
        typedef EdgeType *	EdgePointer		;
        typedef FaceType * FacePointer		;
        typedef TetraType * TetraPointer	;
        typedef HEdgeType * HEdgePointer	;

    static void Name(std::vector<std::string> & /*name*/){}
        template < class LeftV>
        void ImportData(const LeftV  & /*left*/ ) {}
};

template <class A>
    struct Use{
        template <class T> struct AsVertexType: public T{typedef A VertexType;	typedef VertexType * VertexPointer	;};
        template <class T> struct AsEdgeType: public T{typedef A EdgeType;			typedef EdgeType *	EdgePointer			;};
        template <class T> struct AsFaceType: public T{typedef A FaceType;			typedef FaceType * FacePointer			;};
        template <class T> struct AsTetraType: public T{typedef A TetraType;		typedef TetraType * TetraPointer		;};
        template <class T> struct AsHEdgeType: public T{typedef A HEdgeType;		typedef HEdgeType * HEdgePointer		;};
};

template <template <typename> class A = DefaultDeriver, template <typename> class B = DefaultDeriver,
                    template <typename> class C = DefaultDeriver, template <typename> class D = DefaultDeriver,
                    template <typename> class E = DefaultDeriver, template <typename> class F = DefaultDeriver,
                    template <typename> class G = DefaultDeriver, template <typename> class H = DefaultDeriver >
                    class UsedTypes: public Arity13<DummyTypes,
                                Use<  Vertex            <UsedTypes< A, B, C, D , E, F, G, H > > > :: template AsVertexType,
                                Use<  Edge		<UsedTypes< A, B, C, D , E, F, G, H > > > :: template AsEdgeType,
                                Use<  Face		<UsedTypes< A, B, C, D , E, F, G, H > > > :: template AsFaceType,
                                Use<  TetraSimp		<UsedTypes< A, B, C, D , E, F, G, H > > > :: template AsTetraType,
                                Use<  HEdge	  <UsedTypes< A, B, C, D , E, F, G, H > > > :: template AsHEdgeType,
                            A, B, C, D, E, F, G, H
                    >  {
};





struct _UsedTypes: public UsedTypes<
    Use<_Vertex>::AsVertexType,
    Use<_Edge  >::AsEdgeType,
    Use<_Face  >::AsFaceType,
    Use<_Tetra >::AsTetraType,
    Use<_HEdge >::AsHEdgeType
>{};

struct _Vertex: public  Vertex<_UsedTypes>{};
struct _Edge  : public  Edge<_UsedTypes>{};
struct _Face  : public  Face<_UsedTypes>{};
struct _Tetra : public  TetraSimp<_UsedTypes>{};
struct _HEdge : public  HEdge<_UsedTypes>{};

};

#endif // USED_TYPES_H