Skip to content

Commit bb28d11

Browse files
authored
Merge pull request #7 from dyollb/macos_build
fix several issues in mac os build
2 parents ddf527f + 4323256 commit bb28d11

File tree

8 files changed

+22
-13
lines changed

8 files changed

+22
-13
lines changed

Core/HDF5IO.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ HDF5IO::handle_id_type HDF5IO::open(const std::string& fname)
5050

5151
HDF5IO::handle_id_type HDF5IO::create(const std::string& fname, bool append)
5252
{
53+
static_assert(std::is_same<HDF5IO::handle_id_type, hid_t>::value, "hid_t mismatch. this will lead to runtime errors.");
5354
if (append && !existsValidHdf5(fname.c_str()))
5455
{
5556
append = false;

Core/HDF5IO.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#include "iSegCore.h"
1313

14+
#include <hdf5.h>
15+
1416
#include <cstdint>
1517
#include <string>
1618

@@ -19,7 +21,7 @@ namespace iseg {
1921
class iSegCore_API HDF5IO
2022
{
2123
public:
22-
typedef long handle_id_type;
24+
typedef hid_t handle_id_type;
2325

2426
int chunk_size = 0;
2527

Core/HDF5IO.inl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include "HDF5IO.h"
22

3-
#include <hdf5.h>
4-
53
namespace iseg {
64

75
template<typename T>
@@ -155,8 +153,7 @@ bool HDF5IO::writeData(handle_id_type file, const std::string& name,
155153
datatype = H5Tcopy(getTypeValue<T>());
156154
status = H5Tset_order(datatype, H5T_ORDER_LE);
157155

158-
dataset =
159-
H5Dcreate(file, name.c_str(), datatype, dataspace, properties);
156+
dataset = H5Dcreate(file, name.c_str(), datatype, dataspace, properties);
160157
}
161158
else // open existing
162159
{

Core/HDF5Reader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class iSegCore_API HDF5Reader
2222
{
2323
public:
2424
typedef unsigned long long size_type;
25-
typedef int hid_type;
25+
typedef long long hid_type;
2626
HDF5Reader();
2727
~HDF5Reader();
2828
int open(const std::string&);

Core/HDF5Writer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class iSegCore_API HDF5Writer
2121
{
2222
public:
2323
typedef unsigned long long size_type;
24-
typedef int hid_type;
24+
typedef long long hid_type;
2525
HDF5Writer();
2626
~HDF5Writer();
2727

iSeg/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ IF(WIN32)
142142
ELSE()
143143
IF(APPLE)
144144
FILE(GLOB ICON_FILES images/*.png images/*.ico)
145+
SET_SOURCE_FILES_PROPERTIES(${ICON_FILES}
146+
PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/images
147+
)
145148
ENDIF()
146149
ENDIF()
147150

iSeg/XdmfImageWriter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,21 +324,21 @@ int XdmfImageWriter::InternalWrite(const char* filename, float** slicesbmp,
324324
dimension[1] = dims[1];
325325
dimension[2] = dims[2];
326326
dim1[0] = 3;
327-
if (!writer.write(dimension, dim1, std::string("/dimensions")))
327+
if (!writer.write(dimension, dim1, std::string("dimensions")))
328328
{
329329
cerr << "error writing dimensions" << endl;
330330
}
331-
if (!writer.write(offset, dim1, std::string("/offset")))
331+
if (!writer.write(offset, dim1, std::string("offset")))
332332
{
333333
cerr << "error writing offset" << endl;
334334
}
335-
if (!writer.write(pixelsize, dim1, std::string("/pixelsize")))
335+
if (!writer.write(pixelsize, dim1, std::string("pixelsize")))
336336
{
337337
cerr << "error writing pixelsize" << endl;
338338
}
339339
dim1[0] = 6;
340340

341-
if (!writer.write(dc, dim1, std::string("/dc")))
341+
if (!writer.write(dc, dim1, std::string("dc")))
342342
{
343343
cerr << "error writing dc" << endl;
344344
}
@@ -351,7 +351,7 @@ int XdmfImageWriter::InternalWrite(const char* filename, float** slicesbmp,
351351
rotation[k * 3 + 2] = ImageTransform[k][2];
352352
}
353353
dim1[0] = 9;
354-
if (!writer.write(rotation, dim1, std::string("/rotation")))
354+
if (!writer.write(rotation, dim1, std::string("rotation")))
355355
{
356356
cerr << "error writing rotation" << endl;
357357
}

iSeg/main.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,20 +185,26 @@ int main(int argc, char** argv)
185185
{
186186
QString qstr(argv[1]);
187187
if (qstr.compare(QString("S4Llink")) == 0)
188+
{
188189
mainWindow = new MainWindow(
189190
&h3Ds2, QString(locationpath.toAscii().data()), picpath, tmpdir,
190191
true, 0, "new window",
191192
Qt::WDestructiveClose | Qt::WResizeNoErase, argv);
193+
}
192194
}
193195
if (mainWindow == NULL)
196+
{
194197
mainWindow =
195198
new MainWindow(&h3Ds2, QString(locationpath.toAscii().data()),
196199
picpath, tmpdir, false, 0, "new window",
197200
Qt::WDestructiveClose | Qt::WResizeNoErase, argv);
201+
}
198202

199203
QFile qss(stylesheetpath.toAscii().data());
200204
qss.open(QFile::ReadOnly);
201-
mainWindow->setStyleSheet(qss.readAll());
205+
//mainWindow->setStyleSheet(qss.readAll());
206+
cerr << qss.fileName().toStdString() << endl;
207+
mainWindow->setStyleSheet("color: white;");
202208
qss.close();
203209
//mainWindow->setStyleSheet("QDockWidget { color: black; } QDockWidget::title { background: lightgray; padding-left: 5px; padding-top: 3px; } QDockWidget::close-button, QDockWidget::float-button { background: lightgray; } QMenuBar { background-color: gray; } QMenu::separator { background-color: lightgrey; height: 1px; margin-left: 10px; margin-right: 10px; } QMenu::item:disabled { color: darkgrey; }" );
204210

0 commit comments

Comments
 (0)