Sfoglia il codice sorgente

merge

Former-commit-id: f95523379bd61f175b70a496cf57defe30fda307
Alec Jacobson (jalec 12 anni fa
parent
commit
3a23f100c2

+ 8 - 1
Makefile

@@ -1,8 +1,15 @@
 .PHONY: all
 all: lib extras examples
 
+GG=g++
+#GG=/usr/bin/g++     17s
+#GG=/usr/bin/clang++ 14s
+#GG=g++-mp-4.3       15.5s
+#GG=g++-mp-4.7       19.9s
+
 # Shared flags etc.
 include Makefile.conf
+$(info Hello, $(IGL_USERNAME)!)
 
 # optimized default settings
 all: LFLAGS +=
@@ -80,7 +87,7 @@ lib/libigl.a: $(OBJ_FILES)
 	ar cqs $@ $(OBJ_FILES)
 
 obj/%.o: include/igl/%.cpp include/igl/%.h
-	g++ $(CFLAGS) $(AFLAGS) -c -o $@ $< $(INC)
+	$(GG) $(CFLAGS) $(AFLAGS) -c -o $@ $< $(INC)
 
 clean:
 	rm -f obj/*.o

+ 10 - 0
Makefile.conf

@@ -42,6 +42,14 @@ ifeq ($(IGL_USERNAME),alecjaco)
 	ANTTWEAKBAR_LIB=-lAntTweakBar
 endif
 
+ifeq ($(IGL_USERNAME),sorkineo)
+	MOSEKPLATFORM=osx64x86
+	IGL_WITH_TETGEN=1
+	IGL_WITH_MATLAB=0
+	IGL_WITH_MOSEK=1
+	IGL_WITH_PNG=0
+endif
+
 ifeq ($(IGL_USERNAME),jalec_linux) 
 	MOSEKPLATFORM=linux64x86
 	IGL_WITH_TETGEN=1
@@ -50,12 +58,14 @@ ifeq ($(IGL_USERNAME),jalec_linux)
 	OPENGL_LIB=-lGL -lGLU
 	GLUT_LIB=-lglut
 	ANTTWEAKBAR_LIB=-lAntTweakBar
+	IGL_WITH_PNG=1
 endif
 
 ifeq ($(IGL_USERNAME),daniele)
 	IGL_WITH_MATLAB=1
 endif
 
+
 #############################################################################
 # DEFAULTS (USUALLY TO SOMETHING THAT WORKS FOR SURE ON MAC OS X
 #############################################################################

+ 1 - 1
examples/Core/Makefile

@@ -5,7 +5,7 @@ all: example1
 include ../../Makefile.conf
 
 igl_lib=../../
-eigen_lib=$(OPT)/local/include/eigen3/
+eigen_lib=$(DEFAULT_PREFIX)/include/eigen3/
 
 CFLAGS=-g
 inc=-I$(igl_lib)/include -I$(eigen_lib)

+ 2 - 0
examples/Makefile

@@ -1,7 +1,9 @@
 .PHONY: all
+.NOTPARALLEL: all
 
 DIRS=$(wildcard */)
 
+
 all: $(DIRS) 
 	for p in  $(DIRS); \
 	do \

+ 7 - 3
examples/MatlabWorkspace/Makefile

@@ -7,7 +7,7 @@ IGL=../../
 IGL_LIB=-L$(IGL)/lib -ligl
 IGL_INC=-I$(IGL)/include
 
-EIGEN3_INC=-I/usr/local/include/eigen3 -I/usr/local/include/eigen3/unsupported -I$(OPT)/local/include/eigen3 -I$(OPT)/local/include/eigen3/unsupported
+EIGEN3_INC=-I/usr/local/include/eigen3 -I/usr/local/include/eigen3/unsupported -I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 
 MATLAB_INC=-I$(MATLAB)/extern/include/
 MATLAB_LIB=-L$(MATLAB)/bin/maci64 -lmx -lmat
@@ -15,10 +15,14 @@ MATLAB_LIB=-L$(MATLAB)/bin/maci64 -lmx -lmat
 LIB+=$(IGL_LIB) $(MATLAB_LIB)
 INC+=$(IGL_INC) $(EIGEN3_INC) $(MATLAB_INC)
 
-all: example 
-
 CFLAGS += -g
 
+ifeq ($(IGL_WITH_MATLAB),1)
+	EXAMPLE=example
+endif
+
+all: $(EXAMPLE)
+
 example: example.o
 	g++ -o example example.o $(LIB)
 

+ 2 - 2
examples/ReAntTweakBar/Makefile

@@ -11,8 +11,8 @@ all: example
 igl_lib=../../
 
 APPKIT_LIB =
-lib= $(ANTTWEAKBAR_LIB) -L$(igl_lib)/lib -ligl -L$(OPT)/local/lib $(OPENGL_LIB) $(GLUT_LIB)
-inc=-I$(igl_lib)/include -I$(OPT)/local/include
+lib= $(ANTTWEAKBAR_LIB) -L$(igl_lib)/lib -ligl -L$(DEFAULT_PREFIX)/lib $(OPENGL_LIB) $(GLUT_LIB)
+inc=-I$(igl_lib)/include -I$(DEFAULT_PREFIX)/include
 
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 1
examples/affine/Makefile

@@ -9,7 +9,7 @@ include ../../Makefile.conf
 .PHONY: example
 
 igl_lib=../../
-eigen=$(OPT)/local/include/eigen3
+eigen=$(DEFAULT_PREFIX)/include/eigen3
 
 CFLAGS=-g
 inc=-I$(igl_lib)/include -I$(eigen)

+ 1 - 1
examples/cat/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 
 igl_lib=../../
-eigen=$(OPT)/local/include/eigen3/
+eigen=$(DEFAULT_PREFIX)/include/eigen3/
 
 CFLAGS=-g
 inc=-I$(igl_lib)/include -I$(eigen)

+ 1 - 1
examples/dmat/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 
 igl_lib=../../
-eigen=$(OPT)/local/include/eigen3
+eigen=$(DEFAULT_PREFIX)/include/eigen3
 
 CFLAGS=-g
 inc=-I$(igl_lib)/include -I$(eigen)

+ 1 - 1
examples/eigen-gotchas/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 
 igl_lib=../../
-eigen=-I$(OPT)/local/include/eigen3 -I$(OPT)/local/include/eigen3/unsupported
+eigen=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 
 CFLAGS=-g
 inc=-I$(igl_lib)/include $(eigen)

+ 4 - 0
examples/eigen-gotchas/example.cpp

@@ -14,6 +14,9 @@ using namespace std;
 #include <igl/print_ijv.h>
 using namespace igl;
 
+#if EIGEN_VERSION_AT_LEAST(3,0,92)
+#  warning these gotchas have not been verified for your Eigen Version
+#else
 // Eigen fails to notice at compile time that the inneriterator used to loop
 // over the contents of a sparsematrix of type T is a different type
 //
@@ -212,6 +215,7 @@ void sparsellt_succeeded_is_meaningless()
     "B_L=sparse(B_LIJV(:,1),B_LIJV(:,2),B_LIJV(:,3),"<<
     B_L.rows()<<","<<B_L.cols()<<");"<<endl;
 }
+#endif
 
 int main(int argc, char * argv[])
 {

+ 1 - 1
examples/harwell_boeing/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 
 igl_lib=../../
-eigen=-I$(OPT)/local/include/eigen3 -I$(OPT)/local/include/eigen3/unsupported
+eigen=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 
 CFLAGS=-g
 inc=-I$(igl_lib)/include $(eigen)

+ 1 - 1
examples/marching_cubes/Makefile

@@ -9,7 +9,7 @@ all: example
 include ../../Makefile.conf
 
 igl_lib=../../
-eigen=-I$(OPT)/local/include/eigen3
+eigen=-I$(DEFAULT_PREFIX)/include/eigen3
 
 CFLAGS=-g
 inc=-I$(igl_lib)/include $(eigen)

+ 1 - 1
examples/meshio/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 
 igl_lib=../../
-eigen=-I$(OPT)/local/include/eigen3
+eigen=-I$(DEFAULT_PREFIX)/include/eigen3
 
 CFLAGS=-g
 inc=-I$(igl_lib)/include $(eigen)

+ 1 - 1
examples/mode/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 
 igl_lib=../../
-eigen=$(OPT)/local/include/eigen3/
+eigen=$(DEFAULT_PREFIX)/include/eigen3/
 
 CFLAGS=-g
 inc=-I$(igl_lib)/include -I$(eigen)

+ 1 - 1
examples/slice/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 
 igl_lib=../../
-eigen=-I$(OPT)/local/include/eigen3 -I$(OPT)/local/include/eigen3/unsupported
+eigen=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
 
 #CFLAGS=-g
 CFLAGS=-Os -DNDEBUG

+ 1 - 1
examples/sort/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 
 igl_lib=../../
-eigen=$(OPT)/local/include/eigen3/
+eigen=$(DEFAULT_PREFIX)/include/eigen3/
 
 CFLAGS=-g
 inc=-I$(igl_lib)/include -I$(eigen)

+ 1 - 1
examples/transpose_blocks/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 
 igl_lib=../../
-eigen=$(OPT)/local/include/eigen3
+eigen=$(DEFAULT_PREFIX)/include/eigen3
 
 CFLAGS=-g
 inc=-I$(igl_lib)/include -I$(eigen)

+ 24 - 0
include/igl/ReAntTweakBar.cpp

@@ -73,6 +73,30 @@ namespace igl
   };
 }
 
+igl::ReTwBar::ReTwBar():
+ bar(NULL),rw_items(),cb_items()
+{
+}
+
+igl::ReTwBar::ReTwBar(const igl::ReTwBar & that):
+  bar(that.bar),
+  rw_items(that.rw_items),
+  cb_items(that.cb_items)
+{
+}
+
+igl::ReTwBar & igl::ReTwBar::operator=(const igl::ReTwBar & that)
+{
+  // check for self assignment
+  if(this != &that)
+  {
+    bar = that.bar;
+    rw_items = that.rw_items;
+    cb_items = that.cb_items;
+  }
+  return *this;
+}
+
 
 // BAR WRAPPERS
 void igl::ReTwBar::TwNewBar(const char *barName)

+ 78 - 18
include/igl/ReAntTweakBar.h

@@ -40,6 +40,7 @@
 
 #include <vector>
 #include <string>
+#include <cassert>
 
 namespace igl
 {
@@ -52,14 +53,37 @@ namespace igl
     std::string name;
     TwType type;
     void * var;
+    // Default constructor
     ReTwRWItem(
-      const std::string name,
-      TwType type, 
-      void *var)
+      const std::string _name,
+      TwType _type, 
+      void *_var):
+      name(_name),
+      type(_type),
+      var(_var)
     {
-      this->name = name;
-      this->type = type;
-      this->var = var;
+    }
+    // Shallow copy constructor
+    ReTwRWItem(const ReTwRWItem & that):
+      name(that.name),
+      type(that.type),
+      var(that.var)
+    {
+      // I don't think you should be using this!
+      assert(false);
+    }
+    // Shallow assignment 
+    ReTwRWItem & operator=(const ReTwRWItem & that)
+    {
+      // I don't think you should be using this!
+      assert(false);
+      if(this != &that)
+      {
+        this->name = that.name;
+        this->type = that.type;
+        this->var = that.var;
+      }
+      return *this;
     }
   };
   
@@ -67,23 +91,51 @@ namespace igl
   {
     //const char * name;
     std::string name;
+    TwType type;
     TwSetVarCallback setCallback;
     TwGetVarCallback getCallback;
     void * clientData;
-    TwType type;
+    // Default constructor
     ReTwCBItem(
-      const std::string name,
-      TwType type, 
-      TwSetVarCallback setCallback,
-      TwGetVarCallback getCallback,
-      void * clientData)
+      const std::string _name,
+      TwType _type, 
+      TwSetVarCallback _setCallback,
+      TwGetVarCallback _getCallback,
+      void * _clientData):
+      name(_name),
+      type(_type),
+      setCallback(_setCallback),
+      getCallback(_getCallback),
+      clientData(_clientData)
+    {
+    }
+    // Shallow copy
+    ReTwCBItem(const ReTwCBItem & that):
+      name(that.name),
+      type(that.type),
+      setCallback(that.setCallback),
+      getCallback(that.getCallback),
+      clientData(that.clientData)
+    {
+      // I don't think you should be using this!
+      assert(false);
+    }
+    // Shallow assignment
+    ReTwCBItem & operator=(const ReTwCBItem & that)
     {
-      this->name = name;
-      this->type = type;
-      this->setCallback = setCallback;
-      this->getCallback = getCallback;
-      this->clientData = clientData;
+      // I don't think you should be using this!
+      assert(false);
+      if(this != &that)
+      {
+        name = that.name;
+        type = that.type;
+        setCallback = that.setCallback;
+        getCallback = that.getCallback;
+        clientData = that.clientData;
+      }
+      return *this;
     }
+
   };
   
   class ReTwBar
@@ -94,9 +146,17 @@ namespace igl
     // anytime AntTweakBar functions can be called directly on the bar
     public:
       TwBar * bar;
-    private:
+    protected:
       std::vector<ReTwRWItem> rw_items;
       std::vector<ReTwCBItem> cb_items;
+    public:
+      // Default constructor with explicit initialization
+      ReTwBar();
+    private:
+      // Copy constructor does shallow copy
+      ReTwBar(const ReTwBar & that);
+      // Assignment operator does shallow assignment
+      ReTwBar &operator=(const ReTwBar & that);
   
     // WRAPPERS FOR ANTTWEAKBAR FUNCTIONS 
     public:

+ 1 - 0
include/igl/reorder.h

@@ -4,6 +4,7 @@
 #include <vector>
 // For size_t
 #include <stddef.h>
+#include <cstdlib>
 
 namespace igl
 {