Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 541f9d33 authored by saubatn's avatar saubatn
Browse files

UPDATED Compiling and linking library-camitkcore ok.

parent f5271de1
......@@ -34,7 +34,9 @@ if("${VTK_VERSION}" VERSION_LESS 6.0)
message(FATAL_ERROR "Found VTK ${VTK_VERSION} version but at least 5.8 is required. Please update your version of VTK.")
endif()
message(STATUS "Found suitable version of VTK : ${VTK_VERSION} (required is at least 6.0.0)")
include(${VTK_USE_FILE})
set(CAMITK_VTK_VERSION ${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR})
include(${VTK_USE_FILE}) # This automatically set the include dirs (remain the link_directories and target_link_libraries)
set(VTK_LIBRARY_DIR ${VTK_DIR}/../..)
#-- CAMITK_DIR variable
set(CAMITK_BIN_DIR ${CAMITK_DIR}/bin )
......@@ -139,44 +141,23 @@ if(MSVC)
set(CAMITK_CORE_LIBRARIES optimized ${CAMITK_CORE_LIB_NAME}
debug ${CAMITK_CORE_LIB_NAME}${CAMITK_DEBUG_POSTFIX}
)
# Construct list of VTK libraries for linking
foreach(VTK_LIBRARY ${VTK_LIBRARIES})
# Clear some errors on VTK configuration
# rename correctly verdict -> vtkverdict library
if(${VTK_LIBRARY} STREQUAL "verdict")
set(VTK_LIBRARY "vtkverdict")
endif()
set(CAMITK_VTK_LIBRARIES ${CAMITK_VTK_LIBRARIES} debug ${VTK_LIBRARY_DIR}/${VTK_LIBRARY}-${CAMITK_VTK_VERSION}${CAMITK_DEBUG_POSTFIX}.lib optimized ${VTK_LIBRARY_DIR}/${VTK_LIBRARY}-${CAMITK_VTK_VERSION}.lib)
endforeach()
# add missing vtkIOExport library
set(CAMITK_VTK_LIBRARIES ${CAMITK_VTK_LIBRARIES} debug ${VTK_LIBRARY_DIR}/vtkIOExport-${CAMITK_VTK_VERSION}${CAMITK_DEBUG_POSTFIX}.lib optimized ${VTK_LIBRARY_DIR}/vtkIOExport-${CAMITK_VTK_VERSION}.lib)
# list of all core dependencies
set(CAMITK_LIBRARIES
debug ${VTK_DIR}/vtkCommon${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkCommon
debug ${VTK_DIR}/vtkFiltering${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkFiltering
debug ${VTK_DIR}/vtkGenericFiltering${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkGenericFiltering
debug ${VTK_DIR}/vtkGraphics${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkGraphics
debug ${VTK_DIR}/vtkHybrid${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkHybrid
debug ${VTK_DIR}/vtkImaging${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkImaging
debug ${VTK_DIR}/vtkIO${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkIO
debug ${VTK_DIR}/vtkRendering${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkRendering
debug ${VTK_DIR}/vtkVolumeRendering${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkVolumeRendering
debug ${VTK_DIR}/vtkftgl${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkftgl
debug ${VTK_DIR}/vtkWidgets${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkWidgets
debug ${VTK_DIR}/QVTK${CAMITK_DEBUG_POSTFIX}.lib
optimized QVTK
debug ${VTK_DIR}/vtkViews${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkViews
debug ${VTK_DIR}/vtkInfovis${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkInfovis
debug ${VTK_DIR}/vtksys${CAMITK_DEBUG_POSTFIX}.lib
optimized vtksys
debug ${VTK_DIR}/vtkfreetype${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkfreetype
debug qtpropertybrowser${CAMITK_DEBUG_POSTFIX}.lib
optimized qtpropertybrowser
debug ${VTK_DIR}/vtkCharts${CAMITK_DEBUG_POSTFIX}.lib
optimized ${VTK_DIR}/vtkCharts.lib
${CAMITK_VTK_LIBRARIES}
debug qtpropertybrowser${CAMITK_DEBUG_POSTFIX}.lib optimized qtpropertybrowser
)
else()
# Name of the core library to link against
......@@ -196,9 +177,9 @@ else()
vtkVolumeRendering
vtkftgl
vtkWidgets
QVTK
qtpropertybrowser
vtkCharts
# QVTK
qtpropertybrowser
)
endif()
......
......@@ -22,6 +22,9 @@ include_directories(
${CAMITK_INCLUDE_DIRECTORIES}
)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
# find all sources files, set rules for qt files...
gather_headers_and_sources(${CAMITK_CORE_LIB_TARGET_NAME})
......@@ -43,6 +46,9 @@ link_directories(${CAMITK_BUILD_BIN_DIR} ${CAMITK_PUBLIC_LIB_DIR})
# because of the Singleton design pattern and various factory bits in CAMITK_CORE_LIB_NAME.
add_library(${CAMITK_CORE_LIB_TARGET_NAME} SHARED ${${CAMITK_CORE_LIB_TARGET_NAME}_SOURCES})
# linking with Qt5
qt5_use_modules(${CAMITK_CORE_LIB_TARGET_NAME} ${CAMITK_QT_COMPONENTS})
# Update XML Project description adding this target as a subproject of the main CamiTK project with
# its dependencies (in the CMake target point of view)
if(PACKAGING_NSIS)
......
......@@ -35,6 +35,7 @@
#include <QtGui>
#include <QSettings>
#include <QApplication>
#include <QMessageBox>
namespace camitk {
......
......@@ -50,6 +50,7 @@
#include <QSettings>
#include <QUrl>
#include <QCloseEvent>
#include <QMimeData>
namespace camitk {
......
......@@ -31,6 +31,7 @@
// -- QT stuff
#include <QDir>
#include <QtGui>
#include <QMessageBox>
namespace camitk {
......
......@@ -103,12 +103,12 @@ Geometry::Geometry(QString label, vtkSmartPointer<vtkPointSet> pointSetPtr, cons
pointsColor[1] = 0.0;
pointsColor[2] = 1.0;
pointsColor[3] = 1.0;
alphaShaded = 0.2;
//-- init generic filter and dataOutput and customPipelineOuput
concreteData = vtkSmartPointer<vtkCastToConcrete>::New();
concreteData->SetInput(this->pointSet);
concreteData->SetInputData(this->pointSet);
worldTransformFilter = vtkSmartPointer<vtkTransformFilter>::New();
vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
......@@ -425,7 +425,6 @@ bool Geometry::removeProp(const QString& name) {
void Geometry::setPointPosition(const unsigned int orderNumber, const double x, const double y, const double z) {
pointSet->GetPoints()->SetPoint(orderNumber, x, y, z);
pointSet->Modified();
pointSet->Update();
}
//------------------------------- setActorColor ----------------------------------------
......@@ -711,7 +710,6 @@ void Geometry::setPointData(vtkSmartPointer<vtkDataArray> da) {
}
// make sure the change is taking into account
pointSet->Modified();
pointSet->Update();
mapper->Update();
}
......
......@@ -31,6 +31,7 @@
// -- QT stuff classes
class QPixmap;
class QMenu;
class QWidget;
namespace camitk {
......
......@@ -172,7 +172,7 @@ void Slice::setOriginalVolume( vtkSmartPointer<vtkImageData> volume ) {
// -------------------- initActors --------------------
void Slice::initActors() {
imgToMapFilter->SetInput(originalVolume);
imgToMapFilter->SetInputData(originalVolume);
if (NULL==lut) {
imgToMapFilter->SetLookupTable(0);
......@@ -180,11 +180,11 @@ void Slice::initActors() {
imgToMapFilter->SetLookupTable(lut);
/* 3D Actor case: directly pluged to the output of imgToMapFilter */
image3DActor->SetInput(imgToMapFilter->GetOutput());
image3DActor->SetInputData(imgToMapFilter->GetOutput());
image3DActor->InterpolateOn();
// 2D actors
image2DActor->SetInput(imgToMapFilter->GetOutput());
image2DActor->SetInputData(imgToMapFilter->GetOutput());
image2DActor->InterpolateOn();
// Pick plane
......@@ -501,7 +501,7 @@ void Slice::updatePixelActorPosition(double x, double y, double z) {
// Create the corresponding mapper
vtkSmartPointer<vtkDataSetMapper> aPixelMapper = vtkSmartPointer<vtkDataSetMapper>::New();
aPixelMapper->SetInput(aPixelGrid);
aPixelMapper->SetInputData(aPixelGrid);
pixelActor->SetMapper(aPixelMapper);
pixelActor->GetProperty()->SetAmbient(1.0);
......
......@@ -293,12 +293,12 @@ void ImageComponent::setImageData(vtkSmartPointer<vtkImageData> anImageData,
// 6. Apply initialImageDataTransform to the image data
vtkSmartPointer<vtkImageReslice> imageResliceFilter = vtkSmartPointer<vtkImageReslice>::New();
imageResliceFilter->SetInput(inputImage);
imageResliceFilter->SetInputData(inputImage);
imageResliceFilter->SetOutputDimensionality(3);
imageResliceFilter->SetResliceAxes(initialImageDataTransform->GetMatrix());
imageResliceFilter->Update();
originalImageData = imageResliceFilter->GetOutput();
originalImageData->Update();
imageResliceFilter->Update();
// 7. Store initialFrameTransform as the current frame
// note: we need to get another matrix instance for the transformation (else it is deleted)
......@@ -333,11 +333,11 @@ vtkSmartPointer<vtkImageData> ImageComponent::getImageDataWithFrameTransform() {
backToOriginalImageDataMatrix->DeepCopy(initialImageDataTransform->GetMatrix());
backToOriginalImageDataMatrix->Invert();
vtkSmartPointer<vtkImageReslice> backToOrigingImageDataFilter = vtkSmartPointer<vtkImageReslice>::New();
backToOrigingImageDataFilter->SetInput(imageDataFramed);
backToOrigingImageDataFilter->SetInputData(imageDataFramed);
backToOrigingImageDataFilter->SetOutputDimensionality(3);
backToOrigingImageDataFilter->SetResliceAxes(backToOriginalImageDataMatrix);
imageDataFramed = backToOrigingImageDataFilter->GetOutput();
imageDataFramed->Update();
backToOrigingImageDataFilter->Update();
// 2. Retrieve the matrice of the user Muser which has been applied to the initial frame
// Assuming Mframe = MinitFrame * Muser
......@@ -361,11 +361,11 @@ vtkSmartPointer<vtkImageData> ImageComponent::getImageDataWithFrameTransform() {
translationTransform->Translate(pos[0], pos[1], pos[2]);
translationTransform->Update();
vtkSmartPointer<vtkImageReslice> translationFilter = vtkSmartPointer<vtkImageReslice>::New();
translationFilter->SetInput(imageDataFramed);
translationFilter->SetInputData(imageDataFramed);
translationFilter->SetOutputDimensionality(3);
translationFilter->SetResliceAxes(translationTransform->GetMatrix());
imageDataFramed = translationFilter->GetOutput();
imageDataFramed->Update();
translationFilter->Update();
// 4. Retrieve the rotation matrix from the user matrix to manually save it
// only if user has modify it
......
......@@ -214,7 +214,7 @@ void MeshComponent::initSelection() {
vtkSmartPointer<vtkDataSetMapper> selectionMapper = vtkSmartPointer<vtkDataSetMapper>::New();
selectionExtractor->SetInputConnection(0, this->getDataPort());
selectionExtractor->SetInput(1, currentSelection);
selectionExtractor->SetInputData(1, currentSelection);
selectionMapper->SetInputConnection(selectionExtractor->GetOutputPort());
......
......@@ -35,7 +35,8 @@ namespace camitk {
// -------------------- constructor --------------------
MeshDataModel::MeshDataModel(MeshComponent * meshComp) :
QAbstractTableModel(meshComp), meshComponent(meshComp) {
// get ready to reset table
beginResetModel();
}
// -------------------- rowCount --------------------
......@@ -306,7 +307,7 @@ QVariant MeshDataModel::headerData(int section, Qt::Orientation orientation, int
}
void MeshDataModel::refresh() {
reset();
endResetModel();
}
const QMap< int, QString > & MeshDataModel::getFieldNames() {
......
......@@ -35,11 +35,11 @@
#include "qtpropertymanager.h"
// -- QT stuff
#include <QtCore/QMetaObject>
#include <QtCore/QMetaProperty>
#include <QtGui/QVBoxLayout>
#include <QtGui/QScrollArea>
#include <QtGui/QMessageBox>
#include <QMetaObject>
#include <QMetaProperty>
#include <QVBoxLayout>
#include <QScrollArea>
#include <QMessageBox>
#include <QSize>
// -- stl stuff
......
......@@ -31,7 +31,7 @@
#include <QtVariantProperty>
// -- QT stuff
#include <QtGui/QWidget>
#include <QWidget>
#include <QPushButton>
#include <QVBoxLayout>
#include <QScrollArea>
......
......@@ -33,7 +33,7 @@
namespace camitk {
//------------ Constructor ------------------------
SliderTextWidget::SliderTextWidget(QWidget* parent, Qt::WFlags fl) : QWidget(parent, fl) {
SliderTextWidget::SliderTextWidget(QWidget* parent, Qt::WindowFlags fl) : QWidget(parent, fl) {
QVBoxLayout *vLayout= new QVBoxLayout(this);
......
......@@ -60,7 +60,7 @@ class CAMITK_API SliderTextWidget : public QWidget {
public:
/// Default constructor, name is automatically used as the text label
SliderTextWidget(QWidget* parent = 0, Qt::WFlags fl = 0);
SliderTextWidget(QWidget* parent = 0, Qt::WindowFlags fl = 0);
/// Destructor
~SliderTextWidget();
......
......@@ -77,7 +77,7 @@ QWidget * Explorer::getWidget(QWidget * parent) {
headerTitles << "Name" << "Size" ;
explorerTree->setHeaderLabels(headerTitles);
explorerTree->header()->setStretchLastSection(false);
explorerTree->header()->setResizeMode(0, QHeaderView::ResizeToContents); // First column stretch to what is needed
explorerTree->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); // First column stretch to what is needed
// Unsortable column
explorerTree->setSortingEnabled(false);
// Multiple selection (click + Shift or Control key)
......
......@@ -72,7 +72,7 @@ QWidget * FrameExplorer::getWidget(QWidget * parent) {
headerTitles << "Name" << "ComponentName" ;
explorerTree->setHeaderLabels(headerTitles);
explorerTree->header()->setStretchLastSection(false);
explorerTree->header()->setResizeMode(0, QHeaderView::ResizeToContents); // First column stretch to what is needed
explorerTree->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); // First column stretch to what is needed
// Unsortable column
explorerTree->setSortingEnabled(false);
// Multiple selection (click + Shift or Control key)
......
......@@ -24,8 +24,8 @@
****************************************************************************/
// -- Core stuff
#include "InteractiveViewer.h"
#include "RendererWidget.h"
#include "InteractiveViewer.h"
#include "SliderSpinBoxWidget.h"
#include "Application.h"
#include "Log.h"
......@@ -2051,7 +2051,7 @@ void InteractiveViewer::picked() {
MeshComponent* mesh = dynamic_cast<MeshComponent*> ( comp );
if ( areaPicker && mesh ) {
vtkSmartPointer<vtkExtractSelectedFrustum> extractor = vtkSmartPointer<vtkExtractSelectedFrustum>::New();
extractor->SetInput ( mesh->getPointSet() );
extractor->SetInputData( mesh->getPointSet() );
extractor->PreserveTopologyOff();
extractor->SetFrustum ( areaPicker->GetFrustum() );
extractor->Update();
......@@ -2070,7 +2070,7 @@ void InteractiveViewer::picked() {
MeshComponent* mesh = dynamic_cast<MeshComponent*> ( comp );
if ( areaPicker && mesh ) {
vtkSmartPointer<vtkExtractSelectedFrustum> extractor = vtkSmartPointer<vtkExtractSelectedFrustum>::New();
extractor->SetInput ( mesh->getPointSet() );
extractor->SetInputData( mesh->getPointSet() );
extractor->PreserveTopologyOff();
extractor->SetFrustum ( areaPicker->GetFrustum() );
extractor->SetFieldType( vtkSelection::POINT);
......@@ -2208,6 +2208,12 @@ void InteractiveViewerFrame::keyPressEvent ( QKeyEvent* e ) {
QWidget::keyPressEvent ( e );
}
// keep this include here (in the namespace camitk) as long as
// CMake automoc generates a camitk namespace error on this moc
// for the RendererWidget member of the InteractiveViewer class.
// By including it, the file kept out library-camitkcore_automoc.cpp
#include "moc_InteractiveViewer.cpp"
}
......
......@@ -31,6 +31,7 @@
#include "CamiTKAPI.h"
#include "Component.h"
#include "Viewer.h"
#include "RendererWidget.h"
//-- QT stuff
#include <QFrame>
......@@ -52,7 +53,6 @@ class vtkEventQtSlotConnect;
namespace camitk {
// -- Core stuff classes
class RendererWidget;
class SliderSpinBoxWidget;
class GeometricObject;
class InterfaceGeometry;
......
......@@ -95,7 +95,7 @@
namespace camitk {
//--------------- Picking Interactor ---------------------------------------
vtkCxxRevisionMacro(vtkInteractorStylePick, "$Revision: 1.1 $");
vtkInstantiatorNewMacro(vtkInteractorStylePick);
vtkStandardNewMacro(vtkInteractorStylePick);
//--------------------------------------------------------------------------
vtkInteractorStylePick::vtkInteractorStylePick() {
......@@ -1422,5 +1422,4 @@ void RendererWidget::setPicker(vtkSmartPointer<vtkAbstractPropPicker> woodyWood)
}
}
}
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