~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to intern/decimation/intern/future/LOD_NdQSDecimator.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * ***** BEGIN GPL LICENSE BLOCK *****
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU General Public License
6
 
 * as published by the Free Software Foundation; either version 2
7
 
 * of the License, or (at your option) any later version.
8
 
 *
9
 
 * This program is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
 * GNU General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program; if not, write to the Free Software Foundation,
16
 
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
 
 *
18
 
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19
 
 * All rights reserved.
20
 
 *
21
 
 * The Original Code is: all of this file.
22
 
 *
23
 
 * Contributor(s): none yet.
24
 
 *
25
 
 * ***** END GPL LICENSE BLOCK *****
26
 
 */
27
 
 
28
 
/** \file decimation/intern/future/LOD_NdQSDecimator.h
29
 
 *  \ingroup decimation
30
 
 */
31
 
 
32
 
 
33
 
#ifndef __LOD_NDQSDECIMATOR_H__
34
 
#define __LOD_NDQSDECIMATOR_H__
35
 
 
36
 
#include "common/NonCopyable.h"
37
 
#include "LOD_ManMesh2.h"
38
 
 
39
 
#include "LOD_EdgeCollapser.h"
40
 
#include "LOD_NdQuadricEditor.h"
41
 
 
42
 
class LOD_ExternBufferEditor;
43
 
class LOD_ExternVColorEditor;
44
 
class LOD_ExternNormalEditor;
45
 
 
46
 
class LOD_NdQSDecimator : public NonCopyable {
47
 
 
48
 
public :
49
 
 
50
 
        static
51
 
                LOD_NdQSDecimator *
52
 
        New(
53
 
                LOD_ManMesh2 &mesh,
54
 
                LOD_ExternNormalEditor &face_editor,
55
 
                LOD_ExternVColorEditor &color_editor,
56
 
                LOD_ExternBufferEditor &extern_editor
57
 
        );
58
 
 
59
 
 
60
 
                bool
61
 
        Arm(
62
 
        );
63
 
 
64
 
 
65
 
                bool
66
 
        Step(
67
 
        );
68
 
 
69
 
private :
70
 
 
71
 
        LOD_NdQSDecimator(
72
 
                LOD_ManMesh2 &mesh,
73
 
                LOD_ExternNormalEditor &face_editor,
74
 
                LOD_ExternVColorEditor &color_editor,
75
 
                LOD_ExternBufferEditor &extern_editor
76
 
        );
77
 
 
78
 
                bool
79
 
        CollapseEdge(
80
 
        );
81
 
 
82
 
                bool
83
 
        BuildHeap(
84
 
        );
85
 
 
86
 
                void
87
 
        UpdateHeap(
88
 
                std::vector<LOD_EdgeInd> &deg_edges,
89
 
                std::vector<LOD_EdgeInd> &new_edges
90
 
        );      
91
 
 
92
 
                void
93
 
        DeletePrimitives(
94
 
                const std::vector<LOD_EdgeInd> & degenerate_edges,
95
 
                const std::vector<LOD_FaceInd> & degenerate_faces,
96
 
                const std::vector<LOD_VertexInd> & degenerate_vertices
97
 
        );
98
 
 
99
 
        // Iterate through the face set 
100
 
        // for each property of the face vertices 
101
 
        // compute a quadric for that property.
102
 
        // Add it to the quadric array. 
103
 
        
104
 
                void
105
 
        ComputePropertyQuadrics(
106
 
        );
107
 
 
108
 
 
109
 
private :       
110
 
 
111
 
                
112
 
        // owned by this class
113
 
        //////////////////////
114
 
 
115
 
        NanPtr<LOD_EdgeCollapser> m_collapser;
116
 
        NanPtr<Heap<LOD_Edge> > m_heap;
117
 
        NanPtr<LOD_NdQuadricEditor> m_quadric_editor;
118
 
 
119
 
        bool m_is_armed;
120
 
 
121
 
        // arguments to New(...)
122
 
        ////////////////////////
123
 
 
124
 
        LOD_ManMesh2 & m_mesh;
125
 
        LOD_ExternNormalEditor & m_face_editor;
126
 
        LOD_ExternBufferEditor & m_extern_editor;
127
 
        LOD_ExternVColorEditor & m_color_editor;        
128
 
 
129
 
        // temporary buffers
130
 
        ////////////////////
131
 
 
132
 
        std::vector<LOD_FaceInd> m_deg_faces;
133
 
        std::vector<LOD_EdgeInd> m_deg_edges;
134
 
        std::vector<LOD_VertexInd> m_deg_vertices;
135
 
 
136
 
        std::vector<LOD_FaceInd> m_update_faces;
137
 
        std::vector<LOD_EdgeInd> m_new_edges;
138
 
        std::vector<LOD_VertexInd> m_update_vertices;
139
 
 
140
 
 
141
 
};
142
 
 
143
 
#endif
144