Explorar o código

compiles without error on jalec_linux again after merge

Former-commit-id: cb7e39faecbdace5842d2f70d42dbdc0c5d4b2f3
Alec Jacobson (jalec %!s(int64=12) %!d(string=hai) anos
pai
achega
067786e9d6

+ 1 - 0
Makefile

@@ -3,6 +3,7 @@ all: lib extras examples
 
 
 # Shared flags etc.
 # Shared flags etc.
 include Makefile.conf
 include Makefile.conf
+$(info Hello, $(IGL_USERNAME)!)
 
 
 # optimized default settings
 # optimized default settings
 all: LFLAGS +=
 all: LFLAGS +=

+ 2 - 0
Makefile.conf

@@ -58,12 +58,14 @@ ifeq ($(IGL_USERNAME),jalec_linux)
 	OPENGL_LIB=-lGL -lGLU
 	OPENGL_LIB=-lGL -lGLU
 	GLUT_LIB=-lglut
 	GLUT_LIB=-lglut
 	ANTTWEAKBAR_LIB=-lAntTweakBar
 	ANTTWEAKBAR_LIB=-lAntTweakBar
+	IGL_WITH_PNG=1
 endif
 endif
 
 
 ifeq ($(IGL_USERNAME),daniele)
 ifeq ($(IGL_USERNAME),daniele)
 	IGL_WITH_MATLAB=1
 	IGL_WITH_MATLAB=1
 endif
 endif
 
 
+
 #############################################################################
 #############################################################################
 # DEFAULTS (USUALLY TO SOMETHING THAT WORKS FOR SURE ON MAC OS X
 # 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
 include ../../Makefile.conf
 
 
 igl_lib=../../
 igl_lib=../../
-eigen_lib=$(OPT)/local/include/eigen3/
+eigen_lib=$(DEFAULT_PREFIX)/include/eigen3/
 
 
 CFLAGS=-g
 CFLAGS=-g
 inc=-I$(igl_lib)/include -I$(eigen_lib)
 inc=-I$(igl_lib)/include -I$(eigen_lib)

+ 7 - 3
examples/MatlabWorkspace/Makefile

@@ -7,7 +7,7 @@ IGL=../../
 IGL_LIB=-L$(IGL)/lib -ligl
 IGL_LIB=-L$(IGL)/lib -ligl
 IGL_INC=-I$(IGL)/include
 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_INC=-I$(MATLAB)/extern/include/
 MATLAB_LIB=-L$(MATLAB)/bin/maci64 -lmx -lmat
 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)
 LIB+=$(IGL_LIB) $(MATLAB_LIB)
 INC+=$(IGL_INC) $(EIGEN3_INC) $(MATLAB_INC)
 INC+=$(IGL_INC) $(EIGEN3_INC) $(MATLAB_INC)
 
 
-all: example 
-
 CFLAGS += -g
 CFLAGS += -g
 
 
+ifeq ($(IGL_WITH_MATLAB),1)
+	EXAMPLE=example
+endif
+
+all: $(EXAMPLE)
+
 example: example.o
 example: example.o
 	g++ -o example example.o $(LIB)
 	g++ -o example example.o $(LIB)
 
 

+ 2 - 2
examples/ReAntTweakBar/Makefile

@@ -11,8 +11,8 @@ all: example
 igl_lib=../../
 igl_lib=../../
 
 
 APPKIT_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
 example: example.o
 	g++ $(CFLAGS) -o example example.o $(lib)
 	g++ $(CFLAGS) -o example example.o $(lib)

+ 1 - 1
examples/affine/Makefile

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

+ 1 - 1
examples/cat/Makefile

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

+ 1 - 1
examples/dmat/Makefile

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

+ 1 - 1
examples/eigen-gotchas/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 .PHONY: example
 
 
 igl_lib=../../
 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=-g
 inc=-I$(igl_lib)/include $(eigen)
 inc=-I$(igl_lib)/include $(eigen)

+ 1 - 1
examples/harwell_boeing/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 .PHONY: example
 
 
 igl_lib=../../
 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=-g
 inc=-I$(igl_lib)/include $(eigen)
 inc=-I$(igl_lib)/include $(eigen)

+ 1 - 1
examples/marching_cubes/Makefile

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

+ 1 - 1
examples/meshio/Makefile

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

+ 1 - 1
examples/mode/Makefile

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

+ 1 - 1
examples/slice/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 .PHONY: example
 
 
 igl_lib=../../
 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=-g
 CFLAGS=-Os -DNDEBUG
 CFLAGS=-Os -DNDEBUG

+ 1 - 1
examples/sort/Makefile

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

+ 1 - 1
examples/transpose_blocks/Makefile

@@ -9,7 +9,7 @@ all: example
 .PHONY: example
 .PHONY: example
 
 
 igl_lib=../../
 igl_lib=../../
-eigen=$(OPT)/local/include/eigen3
+eigen=$(DEFAULT_PREFIX)/include/eigen3
 
 
 CFLAGS=-g
 CFLAGS=-g
 inc=-I$(igl_lib)/include -I$(eigen)
 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
 // BAR WRAPPERS
 void igl::ReTwBar::TwNewBar(const char *barName)
 void igl::ReTwBar::TwNewBar(const char *barName)

+ 78 - 18
include/igl/ReAntTweakBar.h

@@ -40,6 +40,7 @@
 
 
 #include <vector>
 #include <vector>
 #include <string>
 #include <string>
+#include <cassert>
 
 
 namespace igl
 namespace igl
 {
 {
@@ -52,14 +53,37 @@ namespace igl
     std::string name;
     std::string name;
     TwType type;
     TwType type;
     void * var;
     void * var;
+    // Default constructor
     ReTwRWItem(
     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;
     //const char * name;
     std::string name;
     std::string name;
+    TwType type;
     TwSetVarCallback setCallback;
     TwSetVarCallback setCallback;
     TwGetVarCallback getCallback;
     TwGetVarCallback getCallback;
     void * clientData;
     void * clientData;
-    TwType type;
+    // Default constructor
     ReTwCBItem(
     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
   class ReTwBar
@@ -94,9 +146,17 @@ namespace igl
     // anytime AntTweakBar functions can be called directly on the bar
     // anytime AntTweakBar functions can be called directly on the bar
     public:
     public:
       TwBar * bar;
       TwBar * bar;
-    private:
+    protected:
       std::vector<ReTwRWItem> rw_items;
       std::vector<ReTwRWItem> rw_items;
       std::vector<ReTwCBItem> cb_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 
     // WRAPPERS FOR ANTTWEAKBAR FUNCTIONS 
     public:
     public: