git-svn-id: svn://db.shs.com.ru/libs@665 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-12-10 10:22:09 +00:00
parent 86f4e0ad78
commit 9d05dbe6da
24 changed files with 186 additions and 137 deletions

View File

@@ -30,7 +30,7 @@ Mesh::Mesh(GLenum geom_type_): geom_type(geom_type_),
buffer_geom(GL_ARRAY_BUFFER, GL_STATIC_DRAW),
buffer_ind (GL_ELEMENT_ARRAY_BUFFER, GL_STATIC_DRAW) {
hash_ = 0;
changed = hash_changed = objects_changed = selected_changed = true;
changed = hash_changed = true;
//qDebug() << "Mesh, now" << ++_count;
}
@@ -189,14 +189,14 @@ void Mesh::draw(QOpenGLExtraFunctions * f, int count, int type) {
void Mesh::clear() {
vertices_.clear();
normals_.clear();
tangents_.clear();
vertices_ .clear();
normals_ .clear();
tangents_ .clear();
bitangents_.clear();
texcoords_.clear();
triangles_.clear();
lines_.clear();
data_.clear();
texcoords_ .clear();
triangles_ .clear();
lines_ .clear();
data_ .clear();
changed = hash_changed = true;
}
@@ -232,6 +232,40 @@ uint Mesh::hash() const {
}
bool Mesh::isObjectsChanged(int type) const {
return (const_cast<Mesh*>(this))->vaoByType(type)->isObjectsChanged();
}
bool Mesh::isSelectionChanged(int type) const {
return (const_cast<Mesh*>(this))->vaoByType(type)->isSelectionChanged();
}
void Mesh::setObjectsChanged(int type, bool yes) {
vaoByType(type)->setObjectsChanged(yes);
}
void Mesh::setSelectionChanged(int type, bool yes) {
vaoByType(type)->setSelectionChanged(yes);
}
void Mesh::setAllObjectsChanged(bool yes) {
QMapIterator<int, VertexObject * > it(vao_map);
while (it.hasNext())
it.next().value()->setObjectsChanged(yes);
}
void Mesh::setAllSelectionChanged(bool yes) {
QMapIterator<int, VertexObject * > it(vao_map);
while (it.hasNext())
it.next().value()->setSelectionChanged(yes);
}
void Mesh::translatePoints(const QVector3D & dp) {
QMatrix4x4 m;
m.translate(dp);