Эх сурвалжийг харах

inline impl

Former-commit-id: e32227a2dffa2be430a39b8f0fa4ca6da27d5fbb
Alec Jacobson 10 жил өмнө
parent
commit
c91eae696c

+ 19 - 2
include/igl/matlab/mexStream.h

@@ -30,6 +30,23 @@ namespace igl
       inline virtual int overflow(int c = EOF);
   }; 
 }
-// ALWAYS INCLUDE
-#include "MexStream.cpp"
+
+// Implementation 
+inline std::streamsize igl::MexStream::xsputn(
+  const char *s, 
+  std::streamsize n) 
+{
+  mexPrintf("%.*s",n,s);
+  mexEvalString("drawnow;"); // to dump string.
+  return n;
+}
+
+inline int igl::MexStream::overflow(int c) 
+{
+    if (c != EOF) {
+      mexPrintf("%.1s",&c);
+      mexEvalString("drawnow;"); // to dump string.
+    }
+    return 1;
+}
 #endif