Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/pointcache/intern/mesh.h')
-rw-r--r--source/blender/pointcache/intern/mesh.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/source/blender/pointcache/intern/mesh.h b/source/blender/pointcache/intern/mesh.h
new file mode 100644
index 00000000000..261b72b2d12
--- /dev/null
+++ b/source/blender/pointcache/intern/mesh.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2014, Blender Foundation.
+ *
+ * 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.
+ */
+
+#ifndef PTC_MESH_H
+#define PTC_MESH_H
+
+#include <Alembic/AbcGeom/IPolyMesh.h>
+#include <Alembic/AbcGeom/OPolyMesh.h>
+
+#include "reader.h"
+#include "schema.h"
+#include "writer.h"
+
+struct Object;
+struct PointCacheModifierData;
+struct DerivedMesh;
+
+namespace PTC {
+
+class PointCacheWriter : public Writer {
+public:
+ PointCacheWriter(Scene *scene, Object *ob, PointCacheModifierData *pcmd);
+ ~PointCacheWriter();
+
+ void write_sample();
+
+private:
+ Object *m_ob;
+ PointCacheModifierData *m_pcmd;
+
+ AbcGeom::OPolyMesh m_mesh;
+ AbcGeom::OBoolGeomParam m_param_smooth;
+ AbcGeom::OInt32ArrayProperty m_prop_edges;
+ AbcGeom::OInt32ArrayProperty m_prop_edges_index;
+ AbcGeom::ON3fGeomParam m_param_vertex_normals;
+ AbcGeom::ON3fGeomParam m_param_poly_normals;
+ /* note: loop normals are already defined as a parameter in the schema */
+};
+
+class PointCacheReader : public Reader {
+public:
+ PointCacheReader(Scene *scene, Object *ob, PointCacheModifierData *pcmd);
+ ~PointCacheReader();
+
+ DerivedMesh *acquire_result();
+ void discard_result();
+
+ PTCReadSampleResult read_sample(float frame);
+
+private:
+ Object *m_ob;
+ PointCacheModifierData *m_pcmd;
+
+ AbcGeom::IPolyMesh m_mesh;
+ AbcGeom::IBoolGeomParam m_param_smooth;
+ AbcGeom::IInt32ArrayProperty m_prop_edges;
+ AbcGeom::IInt32ArrayProperty m_prop_edges_index;
+ AbcGeom::IN3fGeomParam m_param_loop_normals;
+ AbcGeom::IN3fGeomParam m_param_vertex_normals;
+ AbcGeom::IN3fGeomParam m_param_poly_normals;
+
+ DerivedMesh *m_result;
+};
+
+} /* namespace PTC */
+
+#endif /* PTC_MESH_H */