Commit f8f7c2e2 authored by thery's avatar thery

simplification compilation windows

pb VarInt sous Windows et static const float
parent 0603269f
...@@ -2,13 +2,14 @@ SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin) ...@@ -2,13 +2,14 @@ SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin)
SET (COMMON_LIBS ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${DEVIL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} gzstream AntTweakBar openctm assimp) SET (COMMON_LIBS ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${DEVIL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} gzstream AntTweakBar openctm assimp)
SET(CGoGN_LIBS_D topologyD algoD containerD utilsD) SET(CGoGN_LIBS_R topology algo container utils)
SET(CGoGN_LIBS_R topology algo container utils)
IF(WIN32) IF(WIN32)
SET(CGoGN_LIBS_D topology algo container utils) # libs have same name but in different place in Visual
add_subdirectory(Examples/Release) add_subdirectory(Examples/Release)
add_subdirectory(Tuto) add_subdirectory(Tuto)
ELSE(WIN32) ELSE(WIN32)
SET(CGoGN_LIBS_D topologyD algoD containerD utilsD)
add_subdirectory(Examples/Release) add_subdirectory(Examples/Release)
add_subdirectory(Examples/Debug) add_subdirectory(Examples/Debug)
add_subdirectory(Examples/Tests) add_subdirectory(Examples/Tests)
......
...@@ -28,9 +28,12 @@ include_directories( ...@@ -28,9 +28,12 @@ include_directories(
) )
# define libs path # define libs path
link_directories( IF(WIN32)
${CGoGN_ROOT_DIR}/lib/Release link_directories( ${CGoGN_ROOT_DIR}/lib/$(ConfigurationName) )
) ELSE(WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/Release )
ENDIF(WIN32)
#define exec to compile #define exec to compile
......
...@@ -2,12 +2,8 @@ cmake_minimum_required(VERSION 2.6) ...@@ -2,12 +2,8 @@ cmake_minimum_required(VERSION 2.6)
project(Tutos) project(Tutos)
#SET (COMMON_LIBS ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${DEVIL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} gzstream AntTweakBar openctm)
SET (CMAKE_BUILD_TYPE Debug) SET (CMAKE_BUILD_TYPE Debug)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
# FOR Qt4 # FOR Qt4
...@@ -28,9 +24,14 @@ include_directories( ...@@ -28,9 +24,14 @@ include_directories(
${CGoGN_ROOT_DIR}/include ${CGoGN_ROOT_DIR}/include
) )
# define libs path # define libs path
link_directories(${CGoGN_ROOT_DIR}/lib/Release ${CGoGN_ROOT_DIR}/lib/Debug) IF(WIN32)
link_directories(${CGoGN_ROOT_DIR}/lib/$(ConfigurationName))
ELSE(WIN32)
link_directories(${CGoGN_ROOT_DIR}/lib/Release ${CGoGN_ROOT_DIR}/lib/Debug)
ENDIF(WIN32)
#define exec to compile #define exec to compile
......
...@@ -408,7 +408,7 @@ int main(int argc, char **argv) ...@@ -408,7 +408,7 @@ int main(int argc, char **argv)
{ {
using namespace CGoGN::Utils::QT; using namespace CGoGN::Utils::QT;
inputValues( VarInt(0,20,xx, "Entier", inputValues( VarInteger(0,20,xx, "Entier",
VarBool(zz, "Bool", VarBool(zz, "Bool",
VarDbl(0.314,3.14,yy,"Double", VarDbl(0.314,3.14,yy,"Double",
VarSlider(10,100,kk,"Slider", VarSlider(10,100,kk,"Slider",
......
...@@ -8,6 +8,7 @@ SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..) ...@@ -8,6 +8,7 @@ SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
IF (APPLE) IF (APPLE)
SET(CMAKE_OSX_ARCHITECTURES x86_64) SET(CMAKE_OSX_ARCHITECTURES x86_64)
ENDIF(APPLE) ENDIF(APPLE)
...@@ -19,10 +20,10 @@ IF(WIN32) ...@@ -19,10 +20,10 @@ IF(WIN32)
add_subdirectory(gzstream/Build) add_subdirectory(gzstream/Build)
add_subdirectory(Numerical) add_subdirectory(Numerical)
add_subdirectory(Assimp/code) add_subdirectory(Assimp/code)
if(CMAKE_CONFIGURATION_TYPES) # if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Release) # set(CMAKE_CONFIGURATION_TYPES Release)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Use only Release configuration for ThirdParty" FORCE) # set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Use only Release configuration for ThirdParty" FORCE)
endif() # endif()
ELSE(WIN32) ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release) SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
add_custom_target( FakeTargetOpenCTM ALL "make" add_custom_target( FakeTargetOpenCTM ALL "make"
......
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
#include <stdio.h> #include <stdio.h>
#include <limits> #include <limits>
#include <cmath> #include <cmath>
#ifndef PI_DEFINED //#ifndef PI_DEFINED
#define PI_DEFINED //#define PI_DEFINED
const double M_PI = 3.14159265359; //double M_PI = 3.14159265359;
#endif //#endif
#endif #endif
......
...@@ -9,7 +9,8 @@ SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..) ...@@ -9,7 +9,8 @@ SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
SET(CMAKE_MODULE_PATH " ${CMAKE_MODULE_PATH} ${CGoGN_ROOT_DIR}/cmake_modules/") SET(CMAKE_MODULE_PATH " ${CMAKE_MODULE_PATH} ${CGoGN_ROOT_DIR}/cmake_modules/")
find_package(OpenGL) find_package(OpenGL REQUIRED)
find_package(Qt4 REQUIRED)
find_package(GLUT) find_package(GLUT)
# qq definition specifiques pour mac # qq definition specifiques pour mac
...@@ -28,7 +29,6 @@ IF(WIN32) ...@@ -28,7 +29,6 @@ IF(WIN32)
SET(LIBXML2_LIBRARIES xml2) SET(LIBXML2_LIBRARIES xml2)
INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/) INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
LINK_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/lib/) LINK_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/lib/)
# add_subdirectory(${CGoGN_ROOT_DIR}/ThirdParty ThirdParty)
add_subdirectory(Release) add_subdirectory(Release)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps) add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
if (EXISTS "${CGoGN_ROOT_DIR}/Perso") if (EXISTS "${CGoGN_ROOT_DIR}/Perso")
...@@ -37,7 +37,7 @@ IF(WIN32) ...@@ -37,7 +37,7 @@ IF(WIN32)
if(CMAKE_CONFIGURATION_TYPES) if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Release Debug) set(CMAKE_CONFIGURATION_TYPES Release Debug)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Use only Release configuration for ThirdParty" FORCE) set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Only Release or Debug" FORCE)
endif() endif()
ELSE(WIN32) ELSE(WIN32)
...@@ -51,7 +51,7 @@ ELSE(WIN32) ...@@ -51,7 +51,7 @@ ELSE(WIN32)
ELSE(IL_LIBRARIES) ELSE(IL_LIBRARIES)
SET(DEVIL_LIBRARIES ${IL_LIBRARY} ${ILU_LIBRARY} ${ILUT_LIBRARY}) SET(DEVIL_LIBRARIES ${IL_LIBRARY} ${ILU_LIBRARY} ${ILUT_LIBRARY})
ENDIF(IL_LIBRARIES) ENDIF(IL_LIBRARIES)
# add_subdirectory(${CGoGN_ROOT_DIR}/ThirdParty ThirdParty)
add_subdirectory(Release) add_subdirectory(Release)
add_subdirectory(Debug) add_subdirectory(Debug)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps) add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
......
...@@ -2,15 +2,17 @@ cmake_minimum_required(VERSION 2.6) ...@@ -2,15 +2,17 @@ cmake_minimum_required(VERSION 2.6)
project(CGoGNDebug) project(CGoGNDebug)
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Debug)
#SET(BUILD_SHARED_LIBS,FALSE)
SET(CMAKE_BUILD_TYPE Debug) SET(CMAKE_BUILD_TYPE Debug)
IF(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Debug)
ENDIF(WIN32)
#SET(BUILD_SHARED_LIBS,FALSE)
# FOR Qt4 # FOR Qt4
FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTOPENGL TRUE) SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE}) INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(${QT_DEFINITIONS})
......
...@@ -2,15 +2,19 @@ cmake_minimum_required(VERSION 2.6) ...@@ -2,15 +2,19 @@ cmake_minimum_required(VERSION 2.6)
project(CGoGNRelease) project(CGoGNRelease)
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release) SET(CMAKE_BUILD_TYPE Release)
IF(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
ENDIF(WIN32)
#SET(BUILD_SHARED_LIBS,FALSE) #SET(BUILD_SHARED_LIBS,FALSE)
SET(CMAKE_BUILD_TYPE Release)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
# FOR Qt4 # FOR Qt4
FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTOPENGL TRUE) SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE}) INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(${QT_DEFINITIONS})
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#define __X_GL_H #define __X_GL_H
#define GLAPIENTRY #define GLAPIENTRY
#include <GL/freeglut.h> #include <GL/glut.h>
#ifndef WIN32 #ifndef WIN32
#ifdef MAC_OSX #ifdef MAC_OSX
...@@ -54,7 +54,7 @@ namespace CGoGN ...@@ -54,7 +54,7 @@ namespace CGoGN
namespace Utils namespace Utils
{ {
APIEXPORT class SimpleGlutWin class SimpleGlutWin
{ {
protected: protected:
// internal values used for the manipulation of object // internal values used for the manipulation of object
......
...@@ -45,7 +45,7 @@ namespace Img3D_IO ...@@ -45,7 +45,7 @@ namespace Img3D_IO
* Initialization of IO * Initialization of IO
* Necessary before any other call * Necessary before any other call
*/ */
void APIEXPORT initIO(); void initIO();
/** /**
* Load bool image (0/255) * Load bool image (0/255)
...@@ -77,7 +77,7 @@ namespace Img3D_IO ...@@ -77,7 +77,7 @@ namespace Img3D_IO
* @param vz voxel size z * @param vz voxel size z
* @param tag image tag * @param tag image tag
*/ */
APIEXPORT void saveBool(ILstring filename, unsigned char* data, int w, int h, int d, float vx, float vy, float vz, int tag); void saveBool(ILstring filename, unsigned char* data, int w, int h, int d, float vx, float vy, float vz, int tag);
/** /**
* Load 8 bits image, if image is boolean compressed, it uncompress it ! * Load 8 bits image, if image is boolean compressed, it uncompress it !
...@@ -92,7 +92,7 @@ namespace Img3D_IO ...@@ -92,7 +92,7 @@ namespace Img3D_IO
* @param tag image tag (reference out) * @param tag image tag (reference out)
* @return a pointer on the image data (that have been allocated by function) * @return a pointer on the image data (that have been allocated by function)
*/ */
APIEXPORT unsigned char* loadVal_8(ILstring filename, int& w, int& h, int &d, float& vx, float& vy, float& vz, int& tag); unsigned char* loadVal_8(ILstring filename, int& w, int& h, int &d, float& vx, float& vy, float& vz, int& tag);
/** /**
* Save 8bits val image * Save 8bits val image
...@@ -108,7 +108,7 @@ namespace Img3D_IO ...@@ -108,7 +108,7 @@ namespace Img3D_IO
* @param vz voxel size z * @param vz voxel size z
* @param tag image tag * @param tag image tag
*/ */
APIEXPORT void saveVal(ILstring filename, unsigned char* data, int w, int h, int d, float vx, float vy, float vz, int tag); void saveVal(ILstring filename, unsigned char* data, int w, int h, int d, float vx, float vy, float vz, int tag);
/** /**
...@@ -124,7 +124,7 @@ namespace Img3D_IO ...@@ -124,7 +124,7 @@ namespace Img3D_IO
* @param tag image tag (reference out) * @param tag image tag (reference out)
* @return a pointer on the image data (that have been allocated by function) * @return a pointer on the image data (that have been allocated by function)
*/ */
APIEXPORT unsigned short* loadVal_16(ILstring filename, int& w, int& h, int &d, float& vx, float& vy, float& vz, int& tag); unsigned short* loadVal_16(ILstring filename, int& w, int& h, int &d, float& vx, float& vy, float& vz, int& tag);
/** /**
* Save 16bits val image * Save 16bits val image
...@@ -140,7 +140,7 @@ namespace Img3D_IO ...@@ -140,7 +140,7 @@ namespace Img3D_IO
* @param vz voxel size z * @param vz voxel size z
* @param tag image tag * @param tag image tag
*/ */
APIEXPORT void saveVal_16(ILstring filename, unsigned short* data, int w, int h, int d, float vx, float vy, float vz, int tag); void saveVal_16(ILstring filename, unsigned short* data, int w, int h, int d, float vx, float vy, float vz, int tag);
/** /**
* Load float value image * Load float value image
...@@ -155,7 +155,7 @@ namespace Img3D_IO ...@@ -155,7 +155,7 @@ namespace Img3D_IO
* @param tag image tag (reference out) * @param tag image tag (reference out)
* @return a pointer on the image data (that have been allocated by function) * @return a pointer on the image data (that have been allocated by function)
*/ */
APIEXPORT float* loadVal_float(ILstring filename, int& w, int& h, int &d, float& vx, float& vy, float& vz, int& id); float* loadVal_float(ILstring filename, int& w, int& h, int &d, float& vx, float& vy, float& vz, int& id);
/** /**
* Save float val image * Save float val image
...@@ -171,7 +171,7 @@ namespace Img3D_IO ...@@ -171,7 +171,7 @@ namespace Img3D_IO
* @param vz voxel size z * @param vz voxel size z
* @param tag image tag * @param tag image tag
*/ */
APIEXPORT void saveVal_float(ILstring filename, float* data, int w, int h, int d, float vx, float vy, float vz, int tag); void saveVal_float(ILstring filename, float* data, int w, int h, int d, float vx, float vy, float vz, int tag);
/** /**
...@@ -187,7 +187,7 @@ namespace Img3D_IO ...@@ -187,7 +187,7 @@ namespace Img3D_IO
* @param tag image tag (reference out) * @param tag image tag (reference out)
* @return a pointer on the image data (that have been allocated by function) * @return a pointer on the image data (that have been allocated by function)
*/ */
APIEXPORT unsigned char* loadRGB(ILstring filename, int& w, int& h, int &d, float& vx, float& vy, float& vz, int& id); unsigned char* loadRGB(ILstring filename, int& w, int& h, int &d, float& vx, float& vy, float& vz, int& id);
/** /**
* Save RGB 8 bits image * Save RGB 8 bits image
...@@ -203,7 +203,7 @@ namespace Img3D_IO ...@@ -203,7 +203,7 @@ namespace Img3D_IO
* @param vz voxel size z * @param vz voxel size z
* @param tag image tag * @param tag image tag
*/ */
APIEXPORT void saveRGB(ILstring filename, unsigned char* data, int w, int h, int d, float vx, float vy, float vz, int tag); void saveRGB(ILstring filename, unsigned char* data, int w, int h, int d, float vx, float vy, float vz, int tag);
} //namespace } //namespace
} //namespace } //namespace
......
...@@ -8,19 +8,10 @@ ...@@ -8,19 +8,10 @@
#include <stdio.h> #include <stdio.h>
#include <limits> #include <limits>
#include <cmath> #include <cmath>
#ifndef PI_DEFINED //#ifndef PI_DEFINED
#define PI_DEFINED //#define PI_DEFINED
const double M_PI = 3.14159265359; //double M_PI=3.14159265359;
#endif //#endif
#ifdef EXPORTING
// #define APIEXPORT __declspec(dllexport)
#define APIEXPORT
#else
// #define APIEXPORT __declspec(dllimport)
#define APIEXPORT
#endif
#else
#define APIEXPORT
#endif #endif
// SPECIFIC FOR MAC // SPECIFIC FOR MAC
......
...@@ -82,15 +82,15 @@ public: ...@@ -82,15 +82,15 @@ public:
* Class for integer input in dialog window (with spinbox) * Class for integer input in dialog window (with spinbox)
* Use: VarBool(min,max,ref_to_val, "label" [,nextVar]) * Use: VarBool(min,max,ref_to_val, "label" [,nextVar])
*/ */
class VarInt: public Var class VarInteger: public Var
{ {
public: public:
int m_min; int m_min;
int m_max; int m_max;
int& m_val; int& m_val;
public: public:
VarInt(int min, int max, int& val, const std::string& label); VarInteger(int min, int max, int& val, const std::string& label);
VarInt(int min, int max, int& val, const std::string& label, const Var& var); VarInteger(int min, int max, int& val, const std::string& label, const Var& var);
QWidget* createInput() const; QWidget* createInput() const;
void updateFrom( QWidget* widg) const; void updateFrom( QWidget* widg) const;
}; };
......
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
protected: protected:
static const float FAR_PLANE=500.0f; static float FAR_PLANE;
SimpleQT* m_cbs; SimpleQT* m_cbs;
......
...@@ -64,7 +64,7 @@ namespace Utils ...@@ -64,7 +64,7 @@ namespace Utils
* The resulting rotation is returned as a quaternion rotation in the * The resulting rotation is returned as a quaternion rotation in the
* first paramater. * first paramater.
*/ */
APIEXPORT void void
trackball(float q[4], float p1x, float p1y, float p2x, float p2y); trackball(float q[4], float p1x, float p1y, float p2x, float p2y);
/* /*
...@@ -75,14 +75,14 @@ trackball(float q[4], float p1x, float p1y, float p2x, float p2y); ...@@ -75,14 +75,14 @@ trackball(float q[4], float p1x, float p1y, float p2x, float p2y);
* rotation, the second and third the total rotation (which will be * rotation, the second and third the total rotation (which will be
* over-written with the resulting new total rotation). * over-written with the resulting new total rotation).
*/ */
APIEXPORT void void
add_quats(float *q1, float *q2, float *dest); add_quats(float *q1, float *q2, float *dest);
/* /*
* A useful function, builds a rotation matrix in Matrix based on * A useful function, builds a rotation matrix in Matrix based on
* given quaternion. * given quaternion.
*/ */
APIEXPORT void void
build_rotmatrix(float m[4][4], float q[4]); build_rotmatrix(float m[4][4], float q[4]);
...@@ -93,7 +93,7 @@ void build_rotmatrixgl3(glm::mat4& m, float q[4]); ...@@ -93,7 +93,7 @@ void build_rotmatrixgl3(glm::mat4& m, float q[4]);
* the given vector) and an angle about which to rotate. The angle is * the given vector) and an angle about which to rotate. The angle is
* expressed in radians. The result is put into the third argument. * expressed in radians. The result is put into the third argument.
*/ */
APIEXPORT void void
axis_to_quat(float a[3], float phi, float q[4]); axis_to_quat(float a[3], float phi, float q[4]);
} //namespace Utils } //namespace Utils
......
...@@ -50,8 +50,6 @@ MapRender::MapRender(): ...@@ -50,8 +50,6 @@ MapRender::MapRender():
MapRender::~MapRender() MapRender::~MapRender()
{ {
glDeleteBuffersARB(4, m_VBOBuffers); glDeleteBuffersARB(4, m_VBOBuffers);
delete[] m_VBOBuffers ;
} }
......
...@@ -35,6 +35,7 @@ namespace Utils ...@@ -35,6 +35,7 @@ namespace Utils
namespace QT namespace QT
{ {
float GLWidget::FAR_PLANE=500.0f;
GLWidget::GLWidget(SimpleQT* cbs, QWidget *parent) : GLWidget::GLWidget(SimpleQT* cbs, QWidget *parent) :
QGLWidget(QGLFormat(QGL::Rgba | QGL::DoubleBuffer| QGL::DepthBuffer), parent), QGLWidget(QGLFormat(QGL::Rgba | QGL::DoubleBuffer| QGL::DepthBuffer), parent),
......
...@@ -144,20 +144,20 @@ void VarBool::updateFrom( QWidget* widg) const ...@@ -144,20 +144,20 @@ void VarBool::updateFrom( QWidget* widg) const
//class VarInt //class VarInt
VarInt::VarInt(int min, int max, int& val, const std::string& label): VarInteger::VarInteger(int min, int max, int& val, const std::string& label):
m_min(min),m_max(max), m_val(val) m_min(min),m_max(max), m_val(val)
{ {
m_label= label; m_label= label;
} }
VarInt::VarInt(int min, int max, int& val, const std::string& label, const Var& var): VarInteger::VarInteger(int min, int max, int& val, const std::string& label, const Var& var):
Var(var), m_min(min),m_max(max), m_val(val) Var(var), m_min(min),m_max(max), m_val(val)
{ {
m_label= label; m_label= label;
} }
QWidget* VarInt::createInput() const QWidget* VarInteger::createInput() const
{ {
QSpinBox *spin = new QSpinBox(); QSpinBox *spin = new QSpinBox();
spin->setRange(m_min, m_max); spin->setRange(m_min, m_max);
...@@ -165,7 +165,7 @@ QWidget* VarInt::createInput() const ...@@ -165,7 +165,7 @@ QWidget* VarInt::createInput() const
return spin; return spin;
} }
void VarInt::updateFrom( QWidget* widg) const void VarInteger::updateFrom( QWidget* widg) const
{ {
QSpinBox* spin = dynamic_cast<QSpinBox*>(widg); QSpinBox* spin = dynamic_cast<QSpinBox*>(widg);
m_val = spin->value(); m_val = spin->value();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment