Jean-Christophe Fillion-Robin лет назад: 15
Родитель
Сommit
de3ccc443e

+ 5 - 1
CMake/ctkFunctionExecuteProcess.cmake

@@ -19,6 +19,10 @@
 ###########################################################################
 
 #
+# Same as EXECUTE_PROCESS command except it can accept the extra parameter: PATH_LIST
+#
+# According to the platform, either PATH, LD_LIBRARY_PATH or DYLD_LIBRARY_PATH
+# will be updated using the paths specified using PATH_LIST
 #
 #
 
@@ -96,4 +100,4 @@ FUNCTION(ctkFunctionExecuteProcess)
 
   INCLUDE(${output_file})
   
-ENDFUNCTION()
+ENDFUNCTION()

+ 2 - 2
CMakeLists.txt

@@ -227,7 +227,7 @@ ENDIF()
 # Set coverage Flags
 #
 IF(WITH_COVERAGE)
-  IF(CMAKE_CXX_COMPILER_ID AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+  IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
     SET(coverage_flags "-g -fdiagnostics-show-option -fprofile-arcs -ftest-coverage -O3 -DNDEBUG")
     SET(COVERAGE_CXX_FLAGS ${coverage_flags})
     SET(COVERAGE_C_FLAGS ${coverage_flags})
@@ -240,7 +240,7 @@ ENDIF()
 SET(CTK_C_FLAGS "${COVERAGE_C_FLAGS} ${ADDITIONAL_C_FLAGS}")
 SET(CTK_CXX_FLAGS "${VISIBILITY_CXX_FLAGS} ${COVERAGE_CXX_FLAGS} ${ADDITIONAL_CXX_FLAGS}")
 
-IF(CMAKE_CXX_COMPILER_ID AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
   SET(cflags "-fdiagnostics-show-option -Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -fstack-protector-all -D_FORTIFY_SOURCE=2")
   SET(CTK_C_FLAGS "${cflags} ${CTK_C_FLAGS}")
   SET(CTK_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wold-style-cast -Wstrict-null-sentinel -Wsign-promo ${CTK_CXX_FLAGS}")

+ 75 - 38
Libs/Core/ctkLogger.cpp

@@ -22,124 +22,161 @@
 #include <QDebug>
 #include <QSqlDatabase>
 
-#include "ctkLogger.h"
+// CTK includes
+#include <ctkLogger.h>
 
-// log4cpp
-#include "log4qt/log4qt.h"
-#include "log4qt/logger.h"
-#include "log4qt/basicconfigurator.h"
+// Log4Qt includes
+#include <log4qt/log4qt.h>
+#include <log4qt/logger.h>
+#include <log4qt/basicconfigurator.h>
 
 class ctkLoggerPrivate: public ctkPrivate<ctkLogger>
 {
 public:
-  ctkLoggerPrivate() {};
-  ~ctkLoggerPrivate() {};
+  ctkLoggerPrivate(){};
+  ~ctkLoggerPrivate(){};
   Log4Qt::Logger *Logger;
 };
 
+//-----------------------------------------------------------------------------
 ctkLogger::ctkLogger(QString name, QObject* _parent): Superclass(_parent)
 {
   CTK_D(ctkLogger);
-  d->Logger = Log4Qt::Logger::logger( name.toStdString().c_str() );
+  d->Logger = Log4Qt::Logger::logger( name.toStdString().c_str());
 }
 
+//-----------------------------------------------------------------------------
 ctkLogger::~ctkLogger()
 {
 }
 
+//-----------------------------------------------------------------------------
 void ctkLogger::configure()
 {
   Log4Qt::BasicConfigurator::configure();
 }
 
-void ctkLogger::debug ( QString s ) 
+//-----------------------------------------------------------------------------
+void ctkLogger::debug(const QString& s)
 { 
   CTK_D(ctkLogger);
-  d->Logger->debug ( s );
+  d->Logger->debug(s);
 }
-void ctkLogger::info ( QString s ) 
+
+//-----------------------------------------------------------------------------
+void ctkLogger::info(const QString& s)
 { 
   CTK_D(ctkLogger);
-  d->Logger->info ( s );
+  d->Logger->info(s);
 }
-void ctkLogger::trace ( QString s ) 
+
+//-----------------------------------------------------------------------------
+void ctkLogger::trace(const QString& s)
 { 
   CTK_D(ctkLogger);
-  d->Logger->trace ( s );
+  d->Logger->trace(s);
 }
-void ctkLogger::warn ( QString s ) 
+
+//-----------------------------------------------------------------------------
+void ctkLogger::warn(const QString& s)
 { 
   CTK_D(ctkLogger);
-  d->Logger->warn ( s );
+  d->Logger->warn(s);
 }
-void ctkLogger::error ( QString s ) 
+
+//-----------------------------------------------------------------------------
+void ctkLogger::error(const QString& s)
 { 
   CTK_D(ctkLogger);
-  d->Logger->error ( s );
+  d->Logger->error(s);
 }
-void ctkLogger::fatal ( QString s ) 
+
+//-----------------------------------------------------------------------------
+void ctkLogger::fatal(const QString& s)
 { 
   CTK_D(ctkLogger);
-  d->Logger->fatal ( s );
+  d->Logger->fatal(s);
 }
 
-void ctkLogger::setDebug() 
+//-----------------------------------------------------------------------------
+void ctkLogger::setDebug()
 {
   CTK_D(ctkLogger);
-  d->Logger->setLevel ( Log4Qt::Level ( Log4Qt::Level::DEBUG_INT ) ); 
+  d->Logger->setLevel(Log4Qt::Level(Log4Qt::Level::DEBUG_INT));
 }
-void ctkLogger::setInfo() 
+
+//-----------------------------------------------------------------------------
+void ctkLogger::setInfo()
 { 
   CTK_D(ctkLogger);
-  d->Logger->setLevel ( Log4Qt::Level ( Log4Qt::Level::INFO_INT ) ); 
+  d->Logger->setLevel(Log4Qt::Level(Log4Qt::Level::INFO_INT));
 }
-void ctkLogger::setTrace() 
+
+//-----------------------------------------------------------------------------
+void ctkLogger::setTrace()
 { 
   CTK_D(ctkLogger);
-  d->Logger->setLevel ( Log4Qt::Level ( Log4Qt::Level::TRACE_INT ) ); 
+  d->Logger->setLevel(Log4Qt::Level(Log4Qt::Level::TRACE_INT));
 }
-void ctkLogger::setWarn() 
+
+//-----------------------------------------------------------------------------
+void ctkLogger::setWarn()
 { 
   CTK_D(ctkLogger);
-  d->Logger->setLevel ( Log4Qt::Level ( Log4Qt::Level::WARN_INT ) ); 
+  d->Logger->setLevel(Log4Qt::Level(Log4Qt::Level::WARN_INT));
 }
-void ctkLogger::setError() 
+
+//-----------------------------------------------------------------------------
+void ctkLogger::setError()
 { 
   CTK_D(ctkLogger);
-  d->Logger->setLevel ( Log4Qt::Level ( Log4Qt::Level::ERROR_INT ) ); 
+  d->Logger->setLevel(Log4Qt::Level(Log4Qt::Level::ERROR_INT));
 }
-void ctkLogger::setFatal() 
+
+//-----------------------------------------------------------------------------
+void ctkLogger::setFatal()
 { 
   CTK_D(ctkLogger);
-  d->Logger->setLevel ( Log4Qt::Level ( Log4Qt::Level::FATAL_INT ) ); 
+  d->Logger->setLevel(Log4Qt::Level(Log4Qt::Level::FATAL_INT));
 }
 
-bool ctkLogger::isDebugEnabled() 
+//-----------------------------------------------------------------------------
+bool ctkLogger::isDebugEnabled()
 { 
   CTK_D(ctkLogger);
   return d->Logger->isDebugEnabled(); 
 }
-bool ctkLogger::isInfoEnabled() 
+
+//-----------------------------------------------------------------------------
+bool ctkLogger::isInfoEnabled()
 { 
   CTK_D(ctkLogger);
   return d->Logger->isInfoEnabled(); 
 }
-bool ctkLogger::isTraceEnabled() 
+
+//-----------------------------------------------------------------------------
+bool ctkLogger::isTraceEnabled()
 { 
   CTK_D(ctkLogger);
   return d->Logger->isTraceEnabled(); 
 }
-bool ctkLogger::isWarnEnabled() 
+
+//-----------------------------------------------------------------------------
+bool ctkLogger::isWarnEnabled()
 { 
   CTK_D(ctkLogger);
   return d->Logger->isWarnEnabled(); 
 }
-bool ctkLogger::isErrorEnabled() 
+
+//-----------------------------------------------------------------------------
+bool ctkLogger::isErrorEnabled()
 { 
   CTK_D(ctkLogger);
   return d->Logger->isErrorEnabled(); 
 }
-bool ctkLogger::isFatalEnabled() 
+
+//-----------------------------------------------------------------------------
+bool ctkLogger::isFatalEnabled()
 { 
   CTK_D(ctkLogger);
   return d->Logger->isFatalEnabled(); 

+ 7 - 7
Libs/Core/ctkLogger.h

@@ -34,17 +34,17 @@ class CTK_CORE_EXPORT ctkLogger : public QObject
   Q_OBJECT
 public:
   typedef QObject Superclass;
-  explicit ctkLogger ( QString name, QObject* parent = 0 );
+  explicit ctkLogger(QString name, QObject* parent = 0);
   virtual ~ctkLogger ();
 
   static void configure();
   
-  void debug ( QString s );
-  void info ( QString s );
-  void trace ( QString s );
-  void warn ( QString s );
-  void error ( QString s );
-  void fatal ( QString s );
+  void debug(const QString& s);
+  void info(const QString& s);
+  void trace(const QString& s);
+  void warn(const QString& s);
+  void error(const QString& s);
+  void fatal(const QString& s);
 
   void setDebug();
   void setInfo();

+ 1 - 0
Libs/Visualization/VTK/Core/ctkVTKCompositeFunction.cpp

@@ -399,5 +399,6 @@ vtkColorTransferFunction* ctkVTKCompositeFunction::colorTransferFunction()const
 //-----------------------------------------------------------------------------
 void ctkVTKCompositeFunction::removeControlPoint( qreal pos )
 {
+  Q_UNUSED(pos);
   // TO BE IMPLEMENTED
 }

+ 1 - 0
Libs/Visualization/VTK/Core/ctkVTKHistogram.cpp

@@ -339,5 +339,6 @@ void ctkVTKHistogram::build()
 //-----------------------------------------------------------------------------
 void ctkVTKHistogram::removeControlPoint( qreal pos )
 {
+  Q_UNUSED(pos);
   // TO BE IMPLEMENTED
 }

+ 1 - 0
Libs/Visualization/VTK/Core/ctkVTKLookupTable.cpp

@@ -227,5 +227,6 @@ vtkLookupTable* ctkVTKLookupTable::lookupTable()const
 //-----------------------------------------------------------------------------
 void ctkVTKLookupTable::removeControlPoint( qreal pos )
 {
+  Q_UNUSED(pos);
   // TO BE IMPLEMENTED
 }

+ 3 - 4
Libs/Visualization/VTK/Core/ctkVTKPiecewiseFunction.cpp

@@ -289,10 +289,9 @@ vtkPiecewiseFunction* ctkVTKPiecewiseFunction::piecewiseFunction()const
 void ctkVTKPiecewiseFunction::removeControlPoint( qreal pos )
 {
   CTK_D(ctkVTKPiecewiseFunction);
-  int index = -1;
   if (d->PiecewiseFunction.GetPointer() == 0)
-  {
-  return;
-  }
+    {
+    return;
+    }
   d->PiecewiseFunction->RemovePoint( pos );
 }

+ 1 - 0
Libs/Widgets/ctkTransferFunctionControlPointsItem.cpp

@@ -270,6 +270,7 @@ void ctkTransferFunctionControlPointsItem::drawPoints( QPointF iPointF )
 //-----------------------------------------------------------------------------
 void ctkTransferFunctionControlPointsItem::fusionPoints( QPointF iPointF )
 {
+  Q_UNUSED(iPointF);
   // TO BE IMPLEMENTED
   // if 2 points are to close: delete one..?
 }