example2.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // IGL Lib - Simple C++ mesh library
  3. //
  4. // Copyright 2011, Daniele Panozzo. All rights reserved.
  5. //
  6. //
  7. // Example that shows the integration with matlab
  8. //
  9. // IMPORTANT DO NOT REMOVE OR MOVE
  10. #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
  11. #include <iostream>
  12. #include <string>
  13. #include <igl/read.h>
  14. #include <igl/matlabinterface.h>
  15. using namespace std;
  16. int main (int argc, const char * argv[])
  17. {
  18. // This is broken
  19. //// read the header of matlabinterface.h for compilation instructions
  20. //
  21. //Eigen::MatrixXd V,V2;
  22. //Eigen::MatrixXi F,F2;
  23. //
  24. //// Read mesh from file
  25. //igl::read("bunny.off",V,F);
  26. //
  27. //// Send mesh to matlab
  28. //igl::mlsetmatrix("V",V);
  29. //igl::mlsetmatrix("F",F);
  30. //// Plot the mesh from matlab
  31. //igl::mleval("trimesh(F,V(:,1),V(:,2),V(:,3))");
  32. //// Receive mesh from matlab
  33. //igl::mlgetmatrix("V",V2);
  34. //igl::mlgetmatrix("F",F2);
  35. //// Plot the received mesh
  36. //cerr << "V " << endl << V2 << endl;
  37. //cerr << "F " << endl << F2 << endl;
  38. //
  39. //// It is also possible to send scalars
  40. //igl::mlsetscalar("s", 3);
  41. //cerr << "s = " << igl::mlgetscalar("s") << endl;
  42. //// If the program closes the matlab session is killed too..
  43. //getchar();
  44. return 0;
  45. }