~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to krita/ui/kis_3d_object_model.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-10-23 21:09:16 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20121023210916-m82w6zxnxhaxz7va
Tags: 1:2.5.90-0ubuntu1
* New upstream alpha release (LP: #1070436)
  - Add libkactivities-dev and libopenimageio-dev to build-depends
  - Add kubuntu_build_calligraactive.diff to build calligraactive by default
  - Add package for calligraauthor and move files that are shared between
    calligrawords and calligraauthor to calligrawords-common
* Document the patches
* Remove numbers from patches so they follow the same naming scheme as
  the rest of our patches.
* calligra-data breaks replaces krita-data (<< 1:2.5.3) (LP: #1071686)

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
    QFile file(path);
44
44
    if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
45
 
        kDebug() << "File " + model + " Not Found";
46
45
        return;
47
46
    }
48
47
 
93
92
        }
94
93
    } // while
95
94
 
96
 
// DEBUG CODE
97
 
#if 0
98
 
    kDebug() << "(v) vertex: " << m_vertex.size();
99
 
    kDebug() << "(vn) normals: " << m_normal.size();
100
 
    kDebug() << "(usemtl) keys (v): " << m_vertexHash.keys();
101
 
    kDebug() << "(usemtl) keys (vn): " << m_normalHash.keys();
102
 
 
103
 
    int vSize = 0;
104
 
    int nSize = 0;
105
 
    QList<QString> keyList = m_vertexHash.keys();
106
 
    for (int i = 0; i < keyList.size(); i++) {
107
 
        vSize += m_vertexHash[ keyList[i] ].size();
108
 
    }
109
 
    keyList = m_normalHash.keys();
110
 
    for (int i = 0; i < keyList.size(); i++) {
111
 
        nSize += m_normalHash[ keyList[i] ].size();
112
 
    }
113
 
    kDebug() << "(f) faces-vertex: " << vSize;
114
 
    kDebug() << "(f) faces-normal: " << nSize;
115
 
    kDebug() << "(f) faces-vertex/3.0: " << vSize / 3.0;
116
 
    kDebug() << "(f) faces-normal/3.0: " << nSize / 3.0;
117
 
 
118
 
#endif
119
95
}
120
96
 
121
97
#define MODEL_SCALE 30
145
121
 
146
122
        Material m = m_material.value(keyList[k]);
147
123
        glColor3f(m.Kd[0], m.Kd[1], m.Kd[2]);
148
 
#if 0
149
 
        kDebug() << "Name: " << keyList[k];
150
 
        debug(m);
151
 
#endif
152
124
 
153
125
        for (int i = 0; i < m_vertexIndex.size(); i += 3) {
154
126
            for (int j = 0; j < 3; j++) {
195
167
 
196
168
    QFile file(path);
197
169
    if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
198
 
        kDebug() << "File " + fileName + " Not Found";
199
170
        return;
200
171
    }
201
172
 
244
215
        }
245
216
 
246
217
    }
247
 
 
248
 
#if 0
249
 
    QList<QString> list = m_material.keys();
250
 
    kDebug() << list;
251
 
    kDebug() << "----------------------------\n";
252
 
    for (int i = 0; i < list.size(); i++) {
253
 
        kDebug() << list[ i ];
254
 
        debug(m_material.value(list[ i ]));
255
 
    }
256
 
    kDebug() << "----------------------------\n";
257
 
#endif
258
 
 
259
 
}
260
 
 
261
 
 
262
 
void Kis3DObjectModel::debug(Material m)
263
 
{
264
 
    kDebug() << "Ka:" << m.Ka[0] << " " << m.Ka[1] << " " << m.Ka[2];
265
 
    kDebug() << "Kd:" << m.Kd[0] << " " << m.Kd[1] << " " << m.Kd[2];
266
 
    kDebug() << "Ks:" << m.Ks[0] << " " << m.Ks[1] << " " << m.Ks[2];
267
218
}