Here's how i compiled Caret on my Debian system.
i installed the following Debian packages:
libqwt5-qt4-dev (5.2.0-1)
libvtk5-dev (5.4.2-5)
libqt4-dev (4:4.5.3-4)
cmake (2.6.0-6)
libqwtplot3d-qt4-dev (0.2.7+svn1)
i didn't install ITK.
i ran as root:
ln -s /usr/lib/libGL.so.1 /usr/lib/libGL.so
export VTK_INC_DIR=/usr/include/vtk-5.4/
export VTK_LIB_DIR=/usr/lib
export QWT_INC_DIR=/usr/include/qwt-qt4
export QWT_LIB_DIR=/usr/lib
export QTDIR=/usr/share/qt4
# caret_build.patch is attached to this email
patch --strip=1 < ../caret_build.patch
make qmake-dynamic
make build
At this point the caret5 executable is in the "caret" subdirectory.
Now each time before running,
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/qt4/plugins/imageformats
-----
Some notes on caret_build.patch:
* Added compiler define NO_PATENTS which tells caret/GuiRecordingDialog.cxx
and caret_qmake_include.pro not to use vtkMPEG2Writer (NO_PATENTS doesn't
affect caret/GuiRecordingDialog.h, but mb it should)
* Removed all reference to vtkMPEG1Writer.h b/c vtkMPEG1Writer doesnt seem
to exist (anymore?) according to
http://www.vtk.org/doc/release/5.0/html/annotated.html
* Changed the name of some libraries in caret/caret5.pro:
+++ caret_source/caret/caret5.pro 2010-03-15 18:33:52.000000000 -0700
@@ -140,9 +140,9 @@
# FreeBSD also does not have libdl, but integrates its functions
# into libc.
!exists( /etc/rc.conf ) {
- LIBS += -lvtkjpeg \
- -lvtkpng \
- -lvtkexpat \
+ LIBS += -ljpeg \
+ -lpng \
+ -lexpat \
-ldl
* took out some static linking via Q_IMPORT_PLUGIN from caret/main.cxx:
--- caret_source_5.613_orig/caret/main.cxx 2009-07-08 14:17:05.000000000
-0700
+++ caret_source/caret/main.cxx 2010-03-15 18:33:52.000000000 -0700
@@ -523,9 +523,9 @@
//
// needed for static linking to have JPEG support
//
- Q_IMPORT_PLUGIN(qjpeg) //QJpegPlugin)
- Q_IMPORT_PLUGIN(qgif) //QGifPlugin)
- Q_IMPORT_PLUGIN(qtiff) //QTiffPlugin)
+ //Q_IMPORT_PLUGIN(qjpeg) //QJpegPlugin)
+ //Q_IMPORT_PLUGIN(qgif) //QGifPlugin)
+ //Q_IMPORT_PLUGIN(qtiff) //QTiffPlugin)
* vtk's GetNextCell and InsertNextCell now take "vtkIdType" instead of
"int". I changed some variables from type "int" to type "vtkIdType". But
there were some times when integer constants were used or when a for loop
was used with an int counter to iterate --- in those cases i kept it as int
and typecast the ints to vtkIdType. This may not be safe, I don't know, and
I haven't tested those code paths. But it makes it compile... At one point,
I added an #include "vtkCellArray.h", which seems to make vtkIdType defined.
* vtk's PrintSelf now takes a vtkIndent rather than an int. Again, i
typecast. Again, i don't know if this is safe.
* Manually defined HAVE_VTK5 and NO_PATENTS at the top of
caret_qmake_include.pro
* In caret_qmake_include.pro, rather than have the VTK5 code block
conditional upon "exists( $(VTK_INC_DIR)/vtkMPEG2Writer.h )", i made it
conditional upon "contains ( DEFINES, HAVE_VTK5 )", and then, above, added a
block which sets HAVE_VTK5 if exists( $(VTK_INC_DIR)/vtkMPEG2Writer.h )
* In caret_qmake_include.pro, changed some library names:
lvtkjpeg ljpeg
lvtkpng lpng
lvtkexpat lexpat
lvtkzlib lz
lqwt lqwt-qt4
diff -ru caret_source_5.613_orig/caret/GuiRecordingDialog.cxx caret_source/caret/GuiRecordingDialog.cxx
--- caret_source_5.613_orig/caret/GuiRecordingDialog.cxx 2009-08-05 07:56:50.000000000 -0700
+++ caret_source/caret/GuiRecordingDialog.cxx 2010-03-17 19:00:25.000000000 -0700
@@ -58,13 +58,14 @@
#define HAVE_AVI_WRITER 1
#undef HAVE_AVI_WRITER
+#ifndef NO_PATENTS
#ifdef HAVE_VTK5
#ifdef HAVE_AVI_WRITER
#include "vtkAVIWriter.h"
#endif // HAVE_AVI_WRITER
-#include "vtkMPEG1Writer.h"
#include "vtkMPEG2Writer.h"
#endif // HAVE_VTK5
+#endif // NO_PATENTS
#include "BrainModelRunExternalProgram.h"
#include "BrainSet.h"
@@ -168,13 +169,14 @@
dialogLayout->addWidget(tabWidget);
dialogLayout->addLayout(buttonsLayout);
+#ifndef NO_PATENTS
#ifdef HAVE_VTK5
- vtkMpeg1MovieWriter = NULL;
vtkMpeg2MovieWriter = NULL;
#ifdef HAVE_AVI_WRITER
vtkAviMovieWriter = NULL;
#endif // HAVE_AVI_WRITER
#endif // HAVE_VTK5
+#endif // NO_PATENTS
deleteTemporaryImages();
}
@@ -184,15 +186,12 @@
*/
GuiRecordingDialog::~GuiRecordingDialog()
{
+#ifndef NO_PATENTS
#ifdef HAVE_VTK5
if (vtkMpeg2MovieWriter != NULL) {
vtkMpeg2MovieWriter->Delete();
vtkMpeg2MovieWriter = NULL;
}
- if (vtkMpeg1MovieWriter != NULL) {
- vtkMpeg1MovieWriter->Delete();
- vtkMpeg1MovieWriter = NULL;
- }
#ifdef HAVE_AVI_WRITER
if (vtkAviMovieWriter != NULL) {
vtkAviMovieWriter->Delete();
@@ -200,6 +199,7 @@
}
#endif // HAVE_AVI_WRITER
#endif // HAVE_VTK5
+#endif // NO_PATENTS
}
/**
@@ -420,18 +420,18 @@
//
movieFileTypeComboBox->addItem("MPEG (using mpeg_create)",
static_cast<int>(MOVIE_FILE_TYPE_MPEG_CREATE));
+#ifndef NO_PATENTS
#ifdef HAVE_VTK5
- movieFileTypeComboBox->addItem("MPEG1 (using VTK)",
- static_cast<int>(MOVIE_FILE_TYPE_MPEG1_VTK));
- const int mpeg1Index = movieFileTypeComboBox->count() - 1;
+ const int mpeg2Index = movieFileTypeComboBox->count() - 1;
movieFileTypeComboBox->addItem("MPEG2 (using VTK)",
static_cast<int>(MOVIE_FILE_TYPE_MPEG2_VTK));
#ifdef HAVE_AVI_WRITER
movieFileTypeComboBox->addItem("AVI (using VTK)",
static_cast<int>(MOVIE_FILE_TYPE_AVI_VTK));
#endif // HAVE_AVI_WRITER
- movieFileTypeComboBox->setCurrentIndex(mpeg1Index);
+ movieFileTypeComboBox->setCurrentIndex(mpeg2Index);
#endif // HAVE_VTK5
+#endif // NO_PATENTS
movieFileTypeComboBox->addItem("JPEG Images",
static_cast<int>(MOVIE_FILE_TYPE_JPEG_IMAGES));
@@ -535,9 +535,6 @@
case MOVIE_FILE_TYPE_MPEG_CREATE:
createMovieWithMpegCreate(movieName);
break;
- case MOVIE_FILE_TYPE_MPEG1_VTK:
- createMovieWithMpeg1VTK();
- break;
case MOVIE_FILE_TYPE_MPEG2_VTK:
createMovieWithMpeg2VTK();
break;
@@ -567,29 +564,6 @@
return movieType;
}
-
-/**
- * create the movie using VTK's MPEG1.
- */
-void
-GuiRecordingDialog::createMovieWithMpeg1VTK()
-{
-#ifdef HAVE_VTK5
- //
- // Finish the movie
- //
- vtkMpeg1MovieWriter->End();
-
- if (DebugControl::getDebugOn()) {
- std::cout << "MPEG Writer Error Code: " << vtkMpeg1MovieWriter->GetErrorCode() << std::endl;
- }
-
- //
- // Cannot append images so delete all captured images
- //
- deleteTemporaryImages();
-#endif // HAVE_VTK5
-}
/**
* create the movie using VTK's MPEG2.
@@ -597,6 +571,7 @@
void
GuiRecordingDialog::createMovieWithMpeg2VTK()
{
+#ifndef NO_PATENTS
#ifdef HAVE_VTK5
//
// Finish the movie
@@ -612,6 +587,7 @@
//
deleteTemporaryImages();
#endif // HAVE_VTK5
+#endif // NO_PATENTS
}
/**
@@ -620,6 +596,7 @@
void
GuiRecordingDialog::createMovieWithAviVTK()
{
+#ifndef NO_PATENTS
#ifdef HAVE_VTK5
#ifdef HAVE_AVI_WRITER
//
@@ -633,6 +610,7 @@
deleteTemporaryImages();
#endif // HAVE_AVI_WRITER
#endif // HAVE_VTK5
+#endif // NO_PATENTS
}
/**
@@ -821,9 +799,6 @@
case MOVIE_FILE_TYPE_MPEG_CREATE:
addImageToMpegCreate(image);
break;
- case MOVIE_FILE_TYPE_MPEG1_VTK:
- addImageToMpeg1VTK(image);
- break;
case MOVIE_FILE_TYPE_MPEG2_VTK:
addImageToMpeg2VTK(image);
break;
@@ -876,32 +851,6 @@
return vtkImage;
}
-/**
- * add image to movie being created with VTK's MPEG1.
- */
-void
-GuiRecordingDialog::addImageToMpeg1VTK(const QImage& image)
-{
-#ifdef HAVE_VTK5
- const QString fileName(movieNameLineEdit->text());
- vtkImageData* vtkImage = convertQImagetoVTKImageData(image);
- if (vtkMpeg1MovieWriter == NULL) {
- vtkMpeg1MovieWriter = vtkMPEG1Writer::New();
- vtkMpeg1MovieWriter->DebugOn();
- vtkMpeg1MovieWriter->SetFileName(movieNameLineEdit->text().toAscii().constData());
- vtkMpeg1MovieWriter->SetInput(vtkImage);
- vtkMpeg1MovieWriter->Start();
- }
- vtkMpeg1MovieWriter->SetInput(vtkImage);
- vtkMpeg1MovieWriter->Write();
-
- vtkImage->Delete();
-
- if (DebugControl::getDebugOn()) {
- std::cout << "MPEG Writer Error Code: " << vtkMpeg1MovieWriter->GetErrorCode() << std::endl;
- }
-#endif // HAVE_VTK5
-}
/**
* add image to movie being created with VTK's MPEG2.
@@ -909,6 +858,7 @@
void
GuiRecordingDialog::addImageToMpeg2VTK(const QImage& image)
{
+#ifndef NO_PATENTS
#ifdef HAVE_VTK5
const QString fileName(movieNameLineEdit->text());
vtkImageData* vtkImage = convertQImagetoVTKImageData(image);
@@ -928,6 +878,7 @@
std::cout << "MPEG Writer Error Code: " << vtkMpeg2MovieWriter->GetErrorCode() << std::endl;
}
#endif // HAVE_VTK5
+#endif // NO_PATENTS
}
/**
@@ -936,6 +887,7 @@
void
GuiRecordingDialog::addImageToAviVTK(const QImage& /*image*/)
{
+#ifndef NO_PATENTS
#ifdef HAVE_VTK5
#ifdef HAVE_AVI_WRITER
vtkImageData* vtkImage = convertQImagetoVTKImageData(image);
@@ -959,6 +911,7 @@
#endif // HAVE_AVI_WRITER
#endif // HAVE_VTK5
+#endif // NO_PATENTS
}
/**
@@ -1120,11 +1073,8 @@
void
GuiRecordingDialog::deleteTemporaryImages()
{
+#ifndef NO_PATENTS
#ifdef HAVE_VTK5
- if (vtkMpeg1MovieWriter != NULL) {
- vtkMpeg1MovieWriter->Delete();
- vtkMpeg1MovieWriter = NULL;
- }
if (vtkMpeg2MovieWriter != NULL) {
vtkMpeg2MovieWriter->Delete();
vtkMpeg2MovieWriter = NULL;
@@ -1136,6 +1086,7 @@
}
#endif // HAVE_AVI_WRITER
#endif // HAVE_VTK5
+#endif // NO_PATENTS
for (unsigned int i = 0; i < imageNames.size(); i++) {
QFile::remove(imageNames[i]);
diff -ru caret_source_5.613_orig/caret/GuiRecordingDialog.h caret_source/caret/GuiRecordingDialog.h
--- caret_source_5.613_orig/caret/GuiRecordingDialog.h 2009-04-09 08:52:05.000000000 -0700
+++ caret_source/caret/GuiRecordingDialog.h 2010-03-16 18:15:02.000000000 -0700
@@ -43,7 +43,6 @@
class vtkAVIWriter;
class vtkImageData;
-class vtkMPEG1Writer;
class vtkMPEG2Writer;
/// Dialog for recording to movie file.
@@ -98,8 +97,6 @@
enum MOVIE_FILE_TYPE {
/// MPEG with "mpeg_create"
MOVIE_FILE_TYPE_MPEG_CREATE,
- /// MPEG1 using VTK
- MOVIE_FILE_TYPE_MPEG1_VTK,
/// MPEG2 using VTK
MOVIE_FILE_TYPE_MPEG2_VTK,
/// AVI using VTK
@@ -129,9 +126,6 @@
/// create the movie using VTK's MPEG2
void createMovieWithMpeg2VTK();
- /// create the movie using VTK's MPEG1
- void createMovieWithMpeg1VTK();
-
/// create the movie using VTK's AVI
void createMovieWithAviVTK();
@@ -141,9 +135,6 @@
/// add image to movie being created with VTK's MPEG2
void addImageToMpeg2VTK(const QImage& image);
- /// add image to movie being created with VTK's MPEG1
- void addImageToMpeg1VTK(const QImage& image);
-
/// add image to movie being created with VTK's AVI
void addImageToAviVTK(const QImage& image);
@@ -222,9 +213,6 @@
/// pointer for VTK's AVI writer
vtkAVIWriter* vtkAviMovieWriter;
- /// pointer for caret's modified VTK's MPEG2 writer that writes MPEG1
- vtkMPEG1Writer* vtkMpeg1MovieWriter;
-
/// pointer for VTK's MPEG2 writer
vtkMPEG2Writer* vtkMpeg2MovieWriter;
};
diff -ru caret_source_5.613_orig/caret/caret5.pro caret_source/caret/caret5.pro
--- caret_source_5.613_orig/caret/caret5.pro 2009-08-19 07:33:02.000000000 -0700
+++ caret_source/caret/caret5.pro 2010-03-15 18:33:52.000000000 -0700
@@ -140,9 +140,9 @@
# FreeBSD also does not have libdl, but integrates its functions
# into libc.
!exists( /etc/rc.conf ) {
- LIBS += -lvtkjpeg \
- -lvtkpng \
- -lvtkexpat \
+ LIBS += -ljpeg \
+ -lpng \
+ -lexpat \
-ldl
}
diff -ru caret_source_5.613_orig/caret/main.cxx caret_source/caret/main.cxx
--- caret_source_5.613_orig/caret/main.cxx 2009-07-08 14:17:05.000000000 -0700
+++ caret_source/caret/main.cxx 2010-03-15 18:33:52.000000000 -0700
@@ -523,9 +523,9 @@
//
// needed for static linking to have JPEG support
//
- Q_IMPORT_PLUGIN(qjpeg) //QJpegPlugin)
- Q_IMPORT_PLUGIN(qgif) //QGifPlugin)
- Q_IMPORT_PLUGIN(qtiff) //QTiffPlugin)
+ //Q_IMPORT_PLUGIN(qjpeg) //QJpegPlugin)
+ //Q_IMPORT_PLUGIN(qgif) //QGifPlugin)
+ //Q_IMPORT_PLUGIN(qtiff) //QTiffPlugin)
//
// Set the locale to prevent crashes due to non-english date formats
diff -ru caret_source_5.613_orig/caret_brain_set/BrainModelContourToSurfaceConverter.cxx caret_source/caret_brain_set/BrainModelContourToSurfaceConverter.cxx
--- caret_source_5.613_orig/caret_brain_set/BrainModelContourToSurfaceConverter.cxx 2009-04-09 08:50:54.000000000 -0700
+++ caret_source/caret_brain_set/BrainModelContourToSurfaceConverter.cxx 2010-03-15 19:11:18.000000000 -0700
@@ -143,7 +143,7 @@
continue;
}
- int* verts = new int[numPoints];
+ vtkIdType* verts = new vtkIdType[numPoints];
if (lastSectionNumberValid) {
if (sectionNumber != lastSectionNumber) {
@@ -166,7 +166,9 @@
<< ", VTK-section=" << vtkSectionNumber << std::endl;
}
- int pointCount = 0;
+ // this used to be an int.. is this still good now that it is a
+ // vtkIdType?
+ vtkIdType pointCount = 0;
for (int j = 0; j < numPoints; j++) {
float x, y;
cc->getPointXY(j, x, y);
diff -ru caret_source_5.613_orig/caret_brain_set/BrainModelSurface.cxx caret_source/caret_brain_set/BrainModelSurface.cxx
--- caret_source_5.613_orig/caret_brain_set/BrainModelSurface.cxx 2009-12-21 10:14:34.000000000 -0800
+++ caret_source/caret_brain_set/BrainModelSurface.cxx 2010-03-15 19:22:35.000000000 -0700
@@ -1171,7 +1171,8 @@
for (int j = 0; j < numTiles; j++) {
int v[3];
topology->getTile(j, v[0], v[1], v[2]);
- cells->InsertNextCell(3, v);
+ cells->InsertNextCell((vtkIdType)3, (vtkIdType*)v);
+ // warning: is it ok to typecast these ints to vtkIdType?
}
vtkPolyData* polyData = vtkPolyData::New();
@@ -1320,8 +1321,8 @@
vtkCellArray* cells = polyData->GetPolys();
if (cells->GetNumberOfCells() == numTiles) {
int cellID = 0;
- int npts;
- int* pts;
+ vtkIdType npts;
+ vtkIdType* pts;
for (cells->InitTraversal(); cells->GetNextCell(npts, pts); cellID++) {
if (npts == 3) {
int verts[3];
diff -ru caret_source_5.613_orig/caret_brain_set/BrainModelVolumeToSurfaceConverter.cxx caret_source/caret_brain_set/BrainModelVolumeToSurfaceConverter.cxx
--- caret_source_5.613_orig/caret_brain_set/BrainModelVolumeToSurfaceConverter.cxx 2009-04-09 08:50:54.000000000 -0700
+++ caret_source/caret_brain_set/BrainModelVolumeToSurfaceConverter.cxx 2010-03-16 18:07:49.000000000 -0700
@@ -317,9 +317,9 @@
decimater->SetErrorIsAbsolute(1);
if (DebugControl::getDebugOn()) {
- decimater->PrintSelf(std::cout, 3);
+ decimater->PrintSelf(std::cout, (vtkIndent)3); // warning: is it ok to typecast an int to a vtkIndent?
decimater->Update();
- decimater->PrintSelf(std::cout, 3);
+ decimater->PrintSelf(std::cout, (vtkIndent)3);
vtkPolyDataWriter* writer = vtkPolyDataWriter::New();
writer->SetInput(decimater->GetOutput());
writer->SetFileName("surface_decimated.vtk");
diff -ru caret_source_5.613_orig/caret_command/caret_command.pro caret_source/caret_command/caret_command.pro
--- caret_source_5.613_orig/caret_command/caret_command.pro 2009-04-09 08:50:04.000000000 -0700
+++ caret_source/caret_command/caret_command.pro 2010-03-15 18:33:52.000000000 -0700
@@ -118,9 +118,9 @@
# FreeBSD also does not have libdl, but integrates its functions
# into libc.
!exists( /etc/rc.conf ) {
- LIBS += -lvtkjpeg \
- -lvtkpng \
- -lvtkexpat \
+ LIBS += -ljpeg \
+ -lpng \
+ -lexpat \
-ldl
}
diff -ru caret_source_5.613_orig/caret_command/main.cxx caret_source/caret_command/main.cxx
--- caret_source_5.613_orig/caret_command/main.cxx 2009-04-09 08:50:04.000000000 -0700
+++ caret_source/caret_command/main.cxx 2010-03-15 18:33:52.000000000 -0700
@@ -109,9 +109,9 @@
//
// Get image plugins so JPEGs can be loaded
//
- Q_IMPORT_PLUGIN(qjpeg) //QJpegPlugin)
- Q_IMPORT_PLUGIN(qgif) //QGifPlugin)
- Q_IMPORT_PLUGIN(qtiff)
+ //Q_IMPORT_PLUGIN(qjpeg) //QJpegPlugin)
+ //Q_IMPORT_PLUGIN(qgif) //QGifPlugin)
+ //Q_IMPORT_PLUGIN(qtiff)
//
// Get all of the available commands
diff -ru caret_source_5.613_orig/caret_files/TopologyFile.cxx caret_source/caret_files/TopologyFile.cxx
--- caret_source_5.613_orig/caret_files/TopologyFile.cxx 2009-12-11 09:19:17.000000000 -0800
+++ caret_source/caret_files/TopologyFile.cxx 2010-03-15 18:53:04.000000000 -0700
@@ -1395,8 +1395,8 @@
std::vector<int> triangles;
vtkCellArray* polys = polyData->GetPolys();
- int npts;
- int* pts;
+ vtkIdType npts;
+ vtkIdType* pts;
for (polys->InitTraversal(); polys->GetNextCell(npts,pts); ) {
if (npts == 3) {
triangles.push_back(pts[0]);
diff -ru caret_source_5.613_orig/caret_files/TopologyHelper.cxx caret_source/caret_files/TopologyHelper.cxx
--- caret_source_5.613_orig/caret_files/TopologyHelper.cxx 2009-04-29 07:38:25.000000000 -0700
+++ caret_source/caret_files/TopologyHelper.cxx 2010-03-15 18:55:21.000000000 -0700
@@ -185,8 +185,8 @@
if (buildNodeInfo) {
vtkCellArray* polys = vtk->GetPolys();
- int npts;
- int* pts;
+ vtkIdType npts;
+ vtkIdType* pts;
const int maxNodeNum = vtk->GetNumberOfPoints(); //-1;
for (polys->InitTraversal(); polys->GetNextCell(npts,pts); ) {
if (npts != 3) {
@@ -216,8 +216,8 @@
//
vtkCellArray* polys = vtk->GetPolys();
int cellId = 0;
- int npts;
- int* pts;
+ vtkIdType npts;
+ vtkIdType* pts;
for (polys->InitTraversal(); polys->GetNextCell(npts,pts); cellId++) {
if (npts != 3) {
std::cerr << " Polygon is not a triangle in TopologyHelper"
diff -ru caret_source_5.613_orig/caret_files/VtkModelFile.cxx caret_source/caret_files/VtkModelFile.cxx
--- caret_source_5.613_orig/caret_files/VtkModelFile.cxx 2009-06-23 10:23:01.000000000 -0700
+++ caret_source/caret_files/VtkModelFile.cxx 2010-03-15 19:07:01.000000000 -0700
@@ -105,7 +105,7 @@
const Border* border = bf->getBorder(i);
const int numLinks = border->getNumberOfLinks();
if (numLinks > 0) {
- std::vector<int> pts;
+ std::vector<vtkIdType> pts;
for (int j = 0; j < numLinks; j++) {
unsigned char rgbaColor[4] = { 170, 170, 170, 255 };
const int colorIndex = border->getBorderColorIndex();
@@ -468,8 +468,8 @@
const int numVertices = polyData->GetNumberOfVerts();
if (numVertices > 0) {
vtkCellArray* verts = polyData->GetVerts();
- int npts;
- int* pts;
+ vtkIdType npts;
+ vtkIdType* pts;
for (verts->InitTraversal(); verts->GetNextCell(npts, pts); ) {
for (int i = 0; i < npts; i++) {
vertices.push_back(pts[i]);
@@ -483,8 +483,8 @@
const int numLines = polyData->GetNumberOfLines();
if (numLines > 0) {
vtkCellArray* cellLines = polyData->GetLines();
- int npts;
- int* pts;
+ vtkIdType npts;
+ vtkIdType* pts;
for (cellLines->InitTraversal(); cellLines->GetNextCell(npts, pts); ) {
lines.push_back(VtkModelObject(pts, npts));
}
@@ -496,8 +496,8 @@
vtkCellArray* polys = polyData->GetPolys();
const int numPolys = polyData->GetNumberOfPolys();
if (numPolys > 0) {
- int npts;
- int* pts;
+ vtkIdType npts;
+ vtkIdType* pts;
for (polys->InitTraversal(); polys->GetNextCell(npts,pts); ) {
if (npts == 3) {
triangles.push_back(pts[0]);
@@ -763,7 +763,7 @@
//polysVTK->Allocate(size, 25);
for (int j = 0; j < numTriangles; j++) {
const int* v = getTriangle(j);
- polysVTK->InsertNextCell(3, (int*)v);
+ polysVTK->InsertNextCell(3, (vtkIdType*)v);
}
}
const int numPolys = getNumberOfPolygons();
@@ -774,7 +774,7 @@
for (int j = 0; j < numPolys; j++) {
const VtkModelObject* vmo = getPolygon(j);
polysVTK->InsertNextCell(vmo->getNumberOfItems(),
- (int*)vmo->getPointIndex(0));
+ (vtkIdType*)vmo->getPointIndex(0));
}
}
@@ -789,7 +789,7 @@
for (int j = 0; j < numLines; j++) {
const VtkModelObject* vmo = getLine(j);
const int* pts = vmo->getPointIndex(0);
- linesVTK->InsertNextCell(vmo->getNumberOfItems(), (int*)pts);
+ linesVTK->InsertNextCell(vmo->getNumberOfItems(), (vtkIdType*)pts);
}
}
@@ -801,7 +801,7 @@
if (numVerts > 0) {
vertsVTK = vtkCellArray::New();
for (int j = 0; j < numVerts; j++) {
- vertsVTK->InsertNextCell(1, (int*)getVertex(j));
+ vertsVTK->InsertNextCell(1, (vtkIdType*)getVertex(j));
}
}
diff -ru caret_source_5.613_orig/caret_files/VtkModelFile.h caret_source/caret_files/VtkModelFile.h
--- caret_source_5.613_orig/caret_files/VtkModelFile.h 2009-04-09 08:46:19.000000000 -0700
+++ caret_source/caret_files/VtkModelFile.h 2010-03-15 19:02:54.000000000 -0700
@@ -31,6 +31,8 @@
#include "AbstractFile.h"
#include "CoordinateFile.h"
+#include "vtkCellArray.h" // bayle added mb
+
class BorderColorFile;
class BorderFile;
class CellColorFile;
@@ -46,7 +48,7 @@
class VtkModelObject {
public:
/// Constructor
- VtkModelObject(const int* ptsIn, const int numPtsIn) {
+ VtkModelObject(const vtkIdType* ptsIn, const vtkIdType numPtsIn) {
for (int i = 0; i < numPtsIn; i++) {
pts.push_back(ptsIn[i]);
}
diff -ru caret_source_5.613_orig/caret_qmake_include.pro caret_source/caret_qmake_include.pro
--- caret_source_5.613_orig/caret_qmake_include.pro 2010-01-26 07:25:36.000000000 -0800
+++ caret_source/caret_qmake_include.pro 2010-03-17 18:47:24.000000000 -0700
@@ -1,3 +1,12 @@
+DEFINES += HAVE_VTK5
+DEFINES += NO_PATENTS
+
+#
+# Check for VTK 5.x
+#
+exists( $(VTK_INC_DIR)/vtkMPEG2Writer.h ) {
+ DEFINES += HAVE_VTK5
+}
#
# Compile debug on mac since that is where development is done
@@ -126,10 +135,9 @@
#
DEFINES += HAVE_VTK
-#
-# Check for VTK 5.x
-#
-exists( $(VTK_INC_DIR)/vtkMPEG2Writer.h ) {
+
+contains ( DEFINES, HAVE_VTK5 ) {
+
message( "Building WITH VTK5 support" )
@@ -168,16 +176,20 @@
-lvtkMPEG2Encode \
-lvtkFiltering \
-lvtkCommon \
- -lvtkjpeg \
- -lvtkpng \
- -lvtkexpat \
- -lvtkzlib
+ -ljpeg \
+ -lpng \
+ -lexpat \
+ -lz
}
#
# Check for VTK 4.x (does not have vtkMPEG2Writer.h)
#
-!exists( $(VTK_INC_DIR)/vtkMPEG2Writer.h ) {
+#!exists( $(VTK_INC_DIR)/vtkMPEG2Writer.h ) {
+
+
+!contains(DEFINES, HAVE_VTK5) {
+
#
# VTK Libraries for VTK 4.x
#
@@ -196,14 +208,14 @@
-lvtkCommon \
-lvtkFiltering \
-lvtkCommon \
- -lvtkjpeg \
- -lvtkpng \
- -lvtkexpat \
+ -ljpeg \
+ -lpng \
+ -lexpat \
-lvtkDICOMParser \
-lvtksys
!macx {
VTK_LIBS += \
- -lvtkzlib
+ -lz
}
}
@@ -286,7 +298,7 @@
# QWT libraries
#
QWT_LIBS = -L$(QWT_LIB_DIR) \
- -lqwt
+ -lqwt-qt4
}
@@ -367,7 +379,7 @@
# QWT libraries
#
QWT_LIBS = -L$(QWT_LIB_DIR) \
- -lqwt
+ -lqwt-qt4
}
@@ -380,7 +392,7 @@
# QWT libraries
#
QWT_LIBS = -L$(QWT_LIB_DIR) \
- -lqwt
+ -lqwt-qt4
QMAKE_CXXFLAGS_RELEASE += -Wno-deprecated
QMAKE_CXXFLAGS_DEBUG += -Wno-deprecated
_______________________________________________
caret-users mailing list
[email protected]
http://brainvis.wustl.edu/mailman/listinfo/caret-users