[Bf-blender-cvs] [a218df79181] soc-2021-adaptive-cloth: adaptive_cloth: MeshIO: FileType to IOType

ishbosamiya noreply at git.blender.org
Mon Jul 5 17:33:37 CEST 2021


Commit: a218df79181c3ab3ceafd4df4058ec4e7ad2603c
Author: ishbosamiya
Date:   Wed Jun 30 18:25:11 2021 +0530
Branches: soc-2021-adaptive-cloth
https://developer.blender.org/rBa218df79181c3ab3ceafd4df4058ec4e7ad2603c

adaptive_cloth: MeshIO: FileType to IOType

===================================================================

M	source/blender/blenkernel/BKE_cloth_remesh.hh
M	source/blender/blenkernel/tests/BKE_cloth_remesh_test.cc

===================================================================

diff --git a/source/blender/blenkernel/BKE_cloth_remesh.hh b/source/blender/blenkernel/BKE_cloth_remesh.hh
index 2a799666f05..febba7dfb5f 100644
--- a/source/blender/blenkernel/BKE_cloth_remesh.hh
+++ b/source/blender/blenkernel/BKE_cloth_remesh.hh
@@ -355,15 +355,15 @@ class MeshIO {
   blender::Vector<blender::Vector<usize>> line_indices;
 
  public:
-  enum FileType {
-    FILETYPE_OBJ,
+  enum IOType {
+    IOTYPE_OBJ,
   };
 
   MeshIO() = default;
 
-  bool read(const fs::path &filepath, FileType type)
+  bool read(const fs::path &filepath, IOType type)
   {
-    if (type != FILETYPE_OBJ) {
+    if (type != IOTYPE_OBJ) {
       return false;
     }
 
@@ -381,9 +381,9 @@ class MeshIO {
     return read(std::move(fin), type);
   }
 
-  bool read(std::istream &&in, FileType type)
+  bool read(std::istream &&in, IOType type)
   {
-    if (type == FILETYPE_OBJ) {
+    if (type == IOTYPE_OBJ) {
       auto res = this->read_obj(std::move(in));
       if (!res) {
         return false;
@@ -398,9 +398,9 @@ class MeshIO {
     return true;
   }
 
-  bool write(const fs::path &filepath, FileType type)
+  bool write(const fs::path &filepath, IOType type)
   {
-    if (type != FILETYPE_OBJ) {
+    if (type != IOTYPE_OBJ) {
       return false;
     }
 
@@ -420,9 +420,9 @@ class MeshIO {
     return true;
   }
 
-  void write(std::ostream &out, FileType type)
+  void write(std::ostream &out, IOType type)
   {
-    if (type == FILETYPE_OBJ) {
+    if (type == IOTYPE_OBJ) {
       this->write_obj(out);
     }
     else {
@@ -909,7 +909,7 @@ template<typename END, typename EVD, typename EED, typename EFD> class Mesh {
   void read_obj(const fs::path &filepath)
   {
     MeshIO reader;
-    const auto reader_success = reader.read(filepath, MeshIO::FILETYPE_OBJ);
+    const auto reader_success = reader.read(filepath, MeshIO::IOTYPE_OBJ);
     BLI_assert(reader_success); /* must successfully load obj */
 
     this->read(reader);
diff --git a/source/blender/blenkernel/tests/BKE_cloth_remesh_test.cc b/source/blender/blenkernel/tests/BKE_cloth_remesh_test.cc
index a5c10067c6c..b6adb1d0fd7 100644
--- a/source/blender/blenkernel/tests/BKE_cloth_remesh_test.cc
+++ b/source/blender/blenkernel/tests/BKE_cloth_remesh_test.cc
@@ -54,7 +54,7 @@ TEST(cloth_remesh, MeshIO_ReadObj)
 {
   MeshIO reader;
   std::istringstream stream(cube_pos_uv_normal);
-  auto res = reader.read(std::move(stream), MeshIO::FILETYPE_OBJ);
+  auto res = reader.read(std::move(stream), MeshIO::IOTYPE_OBJ);
 
   EXPECT_TRUE(res);
 
@@ -75,11 +75,11 @@ TEST(cloth_remesh, MeshIO_WriteObj)
 {
   MeshIO reader;
   std::istringstream stream_in(cube_pos_uv_normal);
-  auto res = reader.read(std::move(stream_in), MeshIO::FILETYPE_OBJ);
+  auto res = reader.read(std::move(stream_in), MeshIO::IOTYPE_OBJ);
   EXPECT_TRUE(res);
 
   std::ostringstream stream_out;
-  reader.write(stream_out, MeshIO::FILETYPE_OBJ);
+  reader.write(stream_out, MeshIO::IOTYPE_OBJ);
 
   std::string expected =
       "v 1 1 -1\n"
@@ -124,7 +124,7 @@ TEST(cloth_remesh, Mesh_Read)
 {
   MeshIO reader;
   std::istringstream stream(cube_pos_uv_normal);
-  reader.read(std::move(stream), MeshIO::FILETYPE_OBJ);
+  reader.read(std::move(stream), MeshIO::IOTYPE_OBJ);
 
   Mesh<bool, bool, bool, bool> mesh;
   mesh.read(reader);
@@ -164,7 +164,7 @@ TEST(cloth_remesh, Mesh_Write)
 {
   MeshIO reader;
   std::istringstream stream(cube_pos_uv_normal);
-  reader.read(std::move(stream), MeshIO::FILETYPE_OBJ);
+  reader.read(std::move(stream), MeshIO::IOTYPE_OBJ);
 
   Mesh<bool, bool, bool, bool> mesh;
   mesh.read(reader);



More information about the Bf-blender-cvs mailing list