Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CamiTK
CamiTK Community Edition
Commits
541f9d33
Commit
541f9d33
authored
Mar 15, 2016
by
saubatn
Browse files
UPDATED Compiling and linking library-camitkcore ok.
parent
f5271de1
Changes
21
Hide whitespace changes
Inline
Side-by-side
sdk/cmake/modules/CamiTKConfig.cmake.in
View file @
541f9d33
...
...
@@ -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()
...
...
sdk/libraries/core/CMakeLists.txt
View file @
541f9d33
...
...
@@ -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
)
...
...
sdk/libraries/core/ExtensionManager.cpp
View file @
541f9d33
...
...
@@ -35,6 +35,7 @@
#include <QtGui>
#include <QSettings>
#include <QApplication>
#include <QMessageBox>
namespace
camitk
{
...
...
sdk/libraries/core/application/MainWindow.cpp
View file @
541f9d33
...
...
@@ -50,6 +50,7 @@
#include <QSettings>
#include <QUrl>
#include <QCloseEvent>
#include <QMimeData>
namespace
camitk
{
...
...
sdk/libraries/core/component/ComponentExtension.cpp
View file @
541f9d33
...
...
@@ -31,6 +31,7 @@
// -- QT stuff
#include <QDir>
#include <QtGui>
#include <QMessageBox>
namespace
camitk
{
...
...
sdk/libraries/core/component/Geometry.cpp
View file @
541f9d33
...
...
@@ -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
->
SetInput
Data
(
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
();
}
...
...
sdk/libraries/core/component/InterfaceNode.h
View file @
541f9d33
...
...
@@ -31,6 +31,7 @@
// -- QT stuff classes
class
QPixmap
;
class
QMenu
;
class
QWidget
;
namespace
camitk
{
...
...
sdk/libraries/core/component/Slice.cpp
View file @
541f9d33
...
...
@@ -172,7 +172,7 @@ void Slice::setOriginalVolume( vtkSmartPointer<vtkImageData> volume ) {
// -------------------- initActors --------------------
void
Slice
::
initActors
()
{
imgToMapFilter
->
SetInput
(
originalVolume
);
imgToMapFilter
->
SetInput
Data
(
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
->
SetInput
Data
(
imgToMapFilter
->
GetOutput
());
image3DActor
->
InterpolateOn
();
// 2D actors
image2DActor
->
SetInput
(
imgToMapFilter
->
GetOutput
());
image2DActor
->
SetInput
Data
(
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
->
SetInput
Data
(
aPixelGrid
);
pixelActor
->
SetMapper
(
aPixelMapper
);
pixelActor
->
GetProperty
()
->
SetAmbient
(
1.0
);
...
...
sdk/libraries/core/component/image/ImageComponent.cpp
View file @
541f9d33
...
...
@@ -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
->
SetInput
Data
(
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
->
SetInput
Data
(
imageDataFramed
);
backToOrigingImageDataFilter
->
SetOutputDimensionality
(
3
);
backToOrigingImageDataFilter
->
SetResliceAxes
(
backToOriginalImageDataMatrix
);
imageDataFramed
=
backToOrigingImageDataFilter
->
GetOutput
();
i
mageDataF
ramed
->
Update
();
backToOrigingI
mageDataF
ilter
->
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
->
SetInput
Data
(
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
...
...
sdk/libraries/core/component/mesh/MeshComponent.cpp
View file @
541f9d33
...
...
@@ -214,7 +214,7 @@ void MeshComponent::initSelection() {
vtkSmartPointer
<
vtkDataSetMapper
>
selectionMapper
=
vtkSmartPointer
<
vtkDataSetMapper
>::
New
();
selectionExtractor
->
SetInputConnection
(
0
,
this
->
getDataPort
());
selectionExtractor
->
SetInput
(
1
,
currentSelection
);
selectionExtractor
->
SetInput
Data
(
1
,
currentSelection
);
selectionMapper
->
SetInputConnection
(
selectionExtractor
->
GetOutputPort
());
...
...
sdk/libraries/core/component/mesh/MeshDataModel.cpp
View file @
541f9d33
...
...
@@ -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
()
{
...
...
sdk/libraries/core/utils/ObjectController.cpp
View file @
541f9d33
...
...
@@ -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
...
...
sdk/libraries/core/utils/ObjectController.h
View file @
541f9d33
...
...
@@ -31,7 +31,7 @@
#include <QtVariantProperty>
// -- QT stuff
#include <
QtGui/
QWidget>
#include <QWidget>
#include <QPushButton>
#include <QVBoxLayout>
#include <QScrollArea>
...
...
sdk/libraries/core/utils/SliderTextWidget.cpp
View file @
541f9d33
...
...
@@ -33,7 +33,7 @@
namespace
camitk
{
//------------ Constructor ------------------------
SliderTextWidget
::
SliderTextWidget
(
QWidget
*
parent
,
Qt
::
WFlags
fl
)
:
QWidget
(
parent
,
fl
)
{
SliderTextWidget
::
SliderTextWidget
(
QWidget
*
parent
,
Qt
::
W
indow
Flags
fl
)
:
QWidget
(
parent
,
fl
)
{
QVBoxLayout
*
vLayout
=
new
QVBoxLayout
(
this
);
...
...
sdk/libraries/core/utils/SliderTextWidget.h
View file @
541f9d33
...
...
@@ -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
::
W
indow
Flags
fl
=
0
);
/// Destructor
~
SliderTextWidget
();
...
...
sdk/libraries/core/viewer/Explorer.cpp
View file @
541f9d33
...
...
@@ -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
()
->
set
Section
ResizeMode
(
0
,
QHeaderView
::
ResizeToContents
);
// First column stretch to what is needed
// Unsortable column
explorerTree
->
setSortingEnabled
(
false
);
// Multiple selection (click + Shift or Control key)
...
...
sdk/libraries/core/viewer/FrameExplorer.cpp
View file @
541f9d33
...
...
@@ -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
()
->
set
Section
ResizeMode
(
0
,
QHeaderView
::
ResizeToContents
);
// First column stretch to what is needed
// Unsortable column
explorerTree
->
setSortingEnabled
(
false
);
// Multiple selection (click + Shift or Control key)
...
...
sdk/libraries/core/viewer/InteractiveViewer.cpp
View file @
541f9d33
...
...
@@ -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
->
SetInput
Data
(
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
->
SetInput
Data
(
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"
}
...
...
sdk/libraries/core/viewer/InteractiveViewer.h
View file @
541f9d33
...
...
@@ -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
;
...
...
sdk/libraries/core/viewer/RendererWidget.cpp
View file @
541f9d33
...
...
@@ -95,7 +95,7 @@
namespace
camitk
{
//--------------- Picking Interactor ---------------------------------------
vtk
CxxRevision
Macro
(
vtkInteractorStylePick
,
"$Revision: 1.1 $"
);
vtk
InstantiatorNew
Macro
(
vtkInteractorStylePick
);
vtkStandardNewMacro
(
vtkInteractorStylePick
);
//--------------------------------------------------------------------------
vtkInteractorStylePick
::
vtkInteractorStylePick
()
{
...
...
@@ -1422,5 +1422,4 @@ void RendererWidget::setPicker(vtkSmartPointer<vtkAbstractPropPicker> woodyWood)
}
}
}
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment