[Bf-blender-cvs] [950abc6] openvdb: Remove (test) code dealing with an OpenVDB primitive and drawing the VDB tree and its values.
Kévin Dietrich
noreply at git.blender.org
Sat Jul 11 20:27:07 CEST 2015
Commit: 950abc655edf8c5cc8062ecdb4d804108896ed0e
Author: Kévin Dietrich
Date: Fri Jul 10 19:23:44 2015 +0200
Branches: openvdb
https://developer.blender.org/rB950abc655edf8c5cc8062ecdb4d804108896ed0e
Remove (test) code dealing with an OpenVDB primitive and drawing the VDB
tree and its values.
===================================================================
M intern/openvdb/CMakeLists.txt
M intern/openvdb/intern/openvdb_dense_convert.h
D intern/openvdb/intern/openvdb_primitive.cpp
D intern/openvdb/intern/openvdb_primitive.h
D intern/openvdb/intern/openvdb_render.cpp
D intern/openvdb/intern/openvdb_render.h
M intern/openvdb/openvdb_capi.cpp
M intern/openvdb/openvdb_capi.h
M source/blender/blenkernel/BKE_smoke.h
M source/blender/blenkernel/intern/smoke.c
M source/blender/blenloader/intern/readfile.c
M source/blender/blenloader/intern/writefile.c
M source/blender/editors/space_view3d/drawobject.c
M source/blender/makesdna/DNA_smoke_types.h
M source/blender/makesrna/intern/rna_smoke.c
===================================================================
diff --git a/intern/openvdb/CMakeLists.txt b/intern/openvdb/CMakeLists.txt
index dc0c7a8..c0389cd 100644
--- a/intern/openvdb/CMakeLists.txt
+++ b/intern/openvdb/CMakeLists.txt
@@ -29,7 +29,6 @@ set(INC
)
set(INC_SYS
- ${GLEW_INCLUDE_PATH}
)
set(SRC
@@ -50,9 +49,7 @@ if(WITH_OPENVDB)
list(APPEND SRC
intern/openvdb_dense_convert.cpp
- intern/openvdb_primitive.cpp
intern/openvdb_reader.cpp
- intern/openvdb_render.cpp
intern/openvdb_writer.cpp
openvdb_capi.cpp
openvdb_util.cpp
diff --git a/intern/openvdb/intern/openvdb_dense_convert.h b/intern/openvdb/intern/openvdb_dense_convert.h
index cfcefce..1ad9910 100644
--- a/intern/openvdb/intern/openvdb_dense_convert.h
+++ b/intern/openvdb/intern/openvdb_dense_convert.h
@@ -32,7 +32,6 @@
#include <openvdb/tools/Dense.h>
#include <openvdb/tools/Clip.h>
-#include "openvdb_primitive.h"
#include "openvdb_reader.h"
#include "openvdb_writer.h"
@@ -77,10 +76,10 @@ GridType *OpenVDB_export_grid(OpenVDBWriter *writer,
}
template <typename GridType, typename T>
-OpenVDBPrimitive *OpenVDB_import_grid(OpenVDBReader *reader,
- const std::string &name,
- T **data,
- const int res[3])
+void OpenVDB_import_grid(OpenVDBReader *reader,
+ const std::string &name,
+ T **data,
+ const int res[3])
{
using namespace openvdb;
@@ -98,11 +97,6 @@ OpenVDBPrimitive *OpenVDB_import_grid(OpenVDBReader *reader,
}
}
}
-
- OpenVDBPrimitive *vdb_prim = new OpenVDBPrimitive();
- vdb_prim->setGrid(grid);
-
- return vdb_prim;
}
openvdb::GridBase *OpenVDB_export_vector_grid(OpenVDBWriter *writer,
diff --git a/intern/openvdb/intern/openvdb_primitive.cpp b/intern/openvdb/intern/openvdb_primitive.cpp
deleted file mode 100644
index 995a7e8..0000000
--- a/intern/openvdb/intern/openvdb_primitive.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * 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 for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2015 Blender Foundation.
- * All rights reserved.
- *
- * Contributor(s): Kevin Dietrich
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "openvdb_primitive.h"
-
-OpenVDBPrimitive::OpenVDBPrimitive()
-{}
-
-OpenVDBPrimitive::~OpenVDBPrimitive()
-{}
-
-openvdb::GridBase &OpenVDBPrimitive::getGrid()
-{
- return *m_grid;
-}
-
-const openvdb::GridBase &OpenVDBPrimitive::getConstGrid() const
-{
- return *m_grid;
-}
-
-openvdb::GridBase::Ptr OpenVDBPrimitive::getGridPtr()
-{
- return m_grid;
-}
-
-openvdb::GridBase::ConstPtr OpenVDBPrimitive::getConstGridPtr() const
-{
- return m_grid;
-}
-
-void OpenVDBPrimitive::setGrid(openvdb::GridBase::Ptr grid)
-{
- m_grid = grid->copyGrid();
-}
diff --git a/intern/openvdb/intern/openvdb_primitive.h b/intern/openvdb/intern/openvdb_primitive.h
deleted file mode 100644
index 65633df..0000000
--- a/intern/openvdb/intern/openvdb_primitive.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * 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 for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2015 Blender Foundation.
- * All rights reserved.
- *
- * Contributor(s): Kevin Dietrich
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __OPENVDB_PRIMITIVE_H__
-#define __OPENVDB_PRIMITIVE_H__
-
-#include <openvdb/openvdb.h>
-
-class OpenVDBPrimitive {
- openvdb::GridBase::Ptr m_grid;
-
-public:
- OpenVDBPrimitive();
- ~OpenVDBPrimitive();
-
- openvdb::GridBase &getGrid();
- const openvdb::GridBase &getConstGrid() const;
- openvdb::GridBase::Ptr getGridPtr();
- openvdb::GridBase::ConstPtr getConstGridPtr() const;
-
- void setGrid(openvdb::GridBase::Ptr grid);
- void setTransform(const float mat[4][4]);
-};
-
-#endif /* __OPENVDB_PRIMITIVE_H__ */
diff --git a/intern/openvdb/intern/openvdb_render.cpp b/intern/openvdb/intern/openvdb_render.cpp
deleted file mode 100644
index 9434aba..0000000
--- a/intern/openvdb/intern/openvdb_render.cpp
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * 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 for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2015 Blender Foundation.
- * All rights reserved.
- *
- * Contributor(s): Kevin Dietrich
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <GL/glew.h>
-#include <openvdb/openvdb.h>
-
-#include "openvdb_primitive.h"
-#include "openvdb_render.h"
-
-namespace internal {
-
-struct vertex {
- float x, y, z;
-};
-
-static void add_point(std::vector<vertex> *vertices, std::vector<vertex> *colors,
- const openvdb::Vec3f &point, const openvdb::Vec3f &color)
-{
- vertex vert;
- vert.x = point.x();
- vert.y = point.y();
- vert.z = point.z();
- vertices->push_back(vert);
-
- vertex col;
- col.x = color.x();
- col.y = color.y();
- col.z = color.z();
- colors->push_back(col);
-}
-
-static inline vertex get_normal(
- const openvdb::Vec3f &v1, const openvdb::Vec3f &v2,
- const openvdb::Vec3f &v3, const openvdb::Vec3f &v4)
-{
- vertex nor;
- openvdb::Vec3f n1, n2;
-
- n1 = v1 - v3;
- n2 = v2 - v4;
-
- nor.x = n1[1] * n2[2] - n1[2] * n2[1];
- nor.y = n1[2] * n2[0] - n1[0] * n2[2];
- nor.z = n1[0] * n2[1] - n1[1] * n2[0];
-
- return nor;
-}
-
-static void add_box(std::vector<vertex> *vertices,
- std::vector<vertex> *colors,
- std::vector<vertex> *normals,
- const openvdb::Vec3f &min,
- const openvdb::Vec3f &max,
- const openvdb::Vec3f &color,
- const bool shaded)
-{
- using namespace openvdb;
- std::vector<Vec3f> points;
-
- const Vec3f corners[8] = {
- min,
- Vec3f(min.x(), min.y(), max.z()),
- Vec3f(max.x(), min.y(), max.z()),
- Vec3f(max.x(), min.y(), min.z()),
- Vec3f(min.x(), max.y(), min.z()),
- Vec3f(min.x(), max.y(), max.z()),
- max,
- Vec3f(max.x(), max.y(), min.z())
- };
-
- if (shaded) {
- points.push_back(corners[0]);
- points.push_back(corners[1]);
- points.push_back(corners[2]);
- points.push_back(corners[3]);
-
- points.push_back(corners[7]);
- points.push_back(corners[6]);
- points.push_back(corners[5]);
- points.push_back(corners[4]);
-
- points.push_back(corners[4]);
- points.push_back(corners[5]);
- points.push_back(corners[1]);
- points.push_back(corners[0]);
-
- points.push_back(corners[3]);
- points.push_back(corners[2]);
- points.push_back(corners[6]);
- points.push_back(corners[7]);
-
- points.push_back(corners[3]);
- points.push_back(corners[7]);
- points.push_back(corners[4]);
- points.push_back(corners[0]);
-
- points.push_back(corners[1]);
- points.push_back(corners[5]);
- points.push_back(corners[6]);
- points.push_back(corners[2]);
-
- if (normals) {
- int i;
- vertex nor = get_normal(corners[0], corners[1], corners[2], corners[3]);
-
- for (i = 0; i < 4; ++i) {
- normals->push_back(nor);
- }
-
- nor = get_normal(corners[7], corners[6], corners[5], corners[1]);
-
- for (i = 0; i < 4; ++i) {
- normals->push_back(nor);
- }
-
- nor = get_normal(corners[4], corners[5], corners[1], corners[0]);
-
- for (i = 0; i < 4; ++i) {
- normals->push_back(nor);
- }
-
- nor = get_normal(corners[3], corners[2], corners[6], corners[7]);
-
- for (i = 0; i < 4; ++i) {
- normals->push_back(nor);
- }
-
- nor = get_normal(corners[3], corners[7], corners[4], corners[0]);
-
- for (i = 0; i < 4; ++i) {
- normals->push_back(nor);
- }
-
- nor = get_normal(corners[1], corners[5], corners[6], corners[2]);
-
- for (i = 0; i < 4; ++i) {
- normals->push_back(nor);
- }
- }
- }
- else {
- points.push_back(corners[0]);
- points.push_back(corners[3]);
- points.push_back(corners[2]);
- points.push_back(corners[1]);
-
- points.push_back(corners[0]);
- points.push_back(corners[4]);
- points.push_back(corners[5]);
- points.push_back(corners[1]);
-
- points.push_back(corners[7]);
- points.push_back(corners[3]);
- points.push_back(corners[2]);
- points.push_back(corners[6]);
-
- points.push_back(corne
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list