Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r2377 - trunk/scenes


Chronological Thread 
  • From: "Andrew Kensler" < >
  • To:
  • Subject: [Manta] r2377 - trunk/scenes
  • Date: Fri, 13 Feb 2009 14:51:00 -0700 (MST)

Author: aek
Date: Fri Feb 13 14:50:58 2009
New Revision: 2377

Modified:
   trunk/scenes/triangleSceneViewer.cc
Log:
Extended on-the-fly decompression to .ply files, and .ply files references
within .plyg groups.



Modified: trunk/scenes/triangleSceneViewer.cc
==============================================================================
--- trunk/scenes/triangleSceneViewer.cc (original)
+++ trunk/scenes/triangleSceneViewer.cc Fri Feb 13 14:50:58 2009
@@ -126,6 +126,22 @@
         if (!readPlyFile(modelName, AffineTransform::createIdentity(), 
frame, defaultMatl, triangleType))
           printf("error loading or reading ply file: %s\n", 
modelName.c_str());
       }
+#ifndef _WIN32
+      else if (!strncmp(modelName.c_str()+modelName.length()-8, ".ply.bz2", 
8)) {
+        char const *args[] = {"bzip2", "-dc", modelName.c_str(), 0};
+        Decompress decomp(modelName, args);
+        frame = new Mesh;
+        if (!readPlyFile(decomp.get_fifo(), 
AffineTransform::createIdentity(), frame, defaultMatl, triangleType))
+          printf("error loading or reading ply file: %s\n", 
modelName.c_str());
+      }
+      else if (!strncmp(modelName.c_str()+modelName.length()-7, ".ply.gz", 
7)) {
+        char const *args[] = {"gzip", "-dc", modelName.c_str(), 0};
+        Decompress decomp(modelName, args);
+        frame = new Mesh;
+        if (!readPlyFile(decomp.get_fifo(), 
AffineTransform::createIdentity(), frame, defaultMatl, triangleType))
+          printf("error loading or reading ply file: %s\n", 
modelName.c_str());
+      }
+#endif
     }
   }
   else if (!strncmp(modelName.c_str()+modelName.length()-4, ".obj", 4)) {
@@ -142,6 +158,20 @@
   // library that we use makes two passes through the file using rewind(),
   // which doesn't play well with pipes.  Any readers that stream in a
   // single pass should work, however.
+  else if (!strncmp(modelName.c_str()+modelName.length()-8, ".ply.bz2", 8)) {
+    char const *args[] = {"bzip2", "-dc", modelName.c_str(), 0};
+    Decompress decomp(modelName, args);
+    frame = new Mesh;
+    if (!readPlyFile(decomp.get_fifo(), AffineTransform::createIdentity(), 
frame, defaultMatl, triangleType))
+      printf("error loading or reading ply file: %s\n", modelName.c_str());
+  }
+  else if (!strncmp(modelName.c_str()+modelName.length()-7, ".ply.gz", 7)) {
+    char const *args[] = {"gzip", "-dc", modelName.c_str(), 0};
+    Decompress decomp(modelName, args);
+    frame = new Mesh;
+    if (!readPlyFile(decomp.get_fifo(), AffineTransform::createIdentity(), 
frame, defaultMatl, triangleType))
+      printf("error loading or reading ply file: %s\n", modelName.c_str());
+  }
   else if (!strncmp(modelName.c_str()+modelName.length()-7, ".iw.bz2", 7)) {
     char const *args[] = {"bzip2", "-dc", modelName.c_str(), 0};
     Decompress decomp(modelName, args);
@@ -152,12 +182,12 @@
     Decompress decomp(modelName, args);
     frame = readIW(decomp.get_fifo(), triangleType);
   }
-  else if (!strncmp(modelName.c_str()+modelName.length()-7, ".m.bz2", 7)) {
+  else if (!strncmp(modelName.c_str()+modelName.length()-6, ".m.bz2", 6)) {
     char const *args[] = {"bzip2", "-dc", modelName.c_str(), 0};
     Decompress decomp(modelName, args);
     frame = readM(decomp.get_fifo(), defaultMatl, triangleType);
   }
-  else if (!strncmp(modelName.c_str()+modelName.length()-6, ".m.gz", 6)) {
+  else if (!strncmp(modelName.c_str()+modelName.length()-5, ".m.gz", 5)) {
     char const *args[] = {"gzip", "-dc", modelName.c_str(), 0};
     Decompress decomp(modelName, args);
     frame = readM(decomp.get_fifo(), defaultMatl, triangleType);


  • [Manta] r2377 - trunk/scenes, Andrew Kensler, 02/13/2009

Archive powered by MHonArc 2.6.16.

Top of page