Skip to content

Commit 48fc0f3

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master' into showstring-positioning
2 parents cb9b9c5 + 2d4bcf2 commit 48fc0f3

File tree

11 files changed

+153
-79
lines changed

11 files changed

+153
-79
lines changed
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# For more information, please see: http://software.sci.utah.edu
2-
#
2+
#
33
# The MIT License
4-
#
4+
#
55
# Copyright (c) 2015 Scientific Computing and Imaging Institute,
66
# University of Utah.
7-
#
8-
#
7+
#
8+
#
99
# Permission is hereby granted, free of charge, to any person obtaining a
1010
# copy of this software and associated documentation files (the "Software"),
1111
# to deal in the Software without restriction, including without limitation
1212
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
1313
# and/or sell copies of the Software, and to permit persons to whom the
1414
# Software is furnished to do so, subject to the following conditions:
15-
#
15+
#
1616
# The above copyright notice and this permission notice shall be included
17-
# in all copies or substantial portions of the Software.
18-
#
17+
# in all copies or substantial portions of the Software.
18+
#
1919
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2020
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2121
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -33,16 +33,15 @@ ExternalProject_Add(SCI_data_external
3333
SVN_REPOSITORY "${data_SVN_URL}"
3434
SVN_TRUST_CERT 1
3535
SVN_USERNAME "anonymous"
36-
SVN_PASSWIRD ""
36+
SVN_PASSWORD ""
3737
DOWNLOAD_DIR "${sci_data_DIR}"
3838
PATCH_COMMAND ""
3939
INSTALL_DIR ""
40-
INSTALL_COMMAND ""
40+
INSTALL_COMMAND ""
4141
CONFIGURE_COMMAND ""
4242
CMAKE_COMMAND ""
4343
BUILD_COMMAND ""
4444
)
4545

4646
ExternalProject_Get_Property(SCI_data_external BINARY_DIR)
4747
SET(SCI_DATA_DIR ${sci_data_DIR} CACHE PATH "")
48-

src/Core/Datatypes/Tests/ScalarTests.cc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@
2929
#include <gtest/gtest.h>
3030
#include <gmock/gmock.h>
3131
#include <Core/Datatypes/Color.h>
32+
#include <complex>
33+
#include <Core/GeometryPrimitives/Tensor.h>
34+
#include <Core/GeometryPrimitives/Vector.h>
35+
#include <Core/GeometryPrimitives/Point.h>
3236

3337
using ::testing::_;
3438
using ::testing::NiceMock;
3539
using ::testing::DefaultValue;
3640
using ::testing::Return;
3741
using namespace SCIRun::Core::Datatypes;
42+
using namespace SCIRun::Core::Geometry;
3843

3944
TEST(ColorTests, CanParseString)
4045
{
@@ -60,3 +65,33 @@ TEST(ColorTests, EmptyStringYieldsWhite)
6065
ColorRGB c2("");
6166
EXPECT_EQ(c, c2);
6267
}
68+
69+
TEST(BasicDatatypeIOTests, AssertSizesOfFieldDatatypesAreConsistent)
70+
{
71+
ASSERT_EQ(1, sizeof(char));
72+
ASSERT_EQ(1, sizeof(unsigned char));
73+
ASSERT_EQ(2, sizeof(short));
74+
ASSERT_EQ(2, sizeof(unsigned short));
75+
ASSERT_EQ(4, sizeof(int));
76+
ASSERT_EQ(4, sizeof(unsigned int));
77+
ASSERT_EQ(8, sizeof(long long));
78+
ASSERT_EQ(8, sizeof(unsigned long long));
79+
ASSERT_EQ(4, sizeof(float));
80+
ASSERT_EQ(8, sizeof(double));
81+
ASSERT_EQ(2 * sizeof(double), sizeof(std::complex<double>));
82+
ASSERT_EQ(3 * sizeof(double), sizeof(Vector));
83+
ASSERT_EQ(3 * sizeof(double), sizeof(Point));
84+
ASSERT_EQ(
85+
3 * 3 * sizeof(double) + // matrix data
86+
3 * sizeof(Vector) + // eigenvectors
87+
3 * sizeof(double) + // eigenvalues
88+
sizeof(int) + // eigens computed flag (must stay int, not bool)
89+
4, // to get to 8-byte packing
90+
sizeof(Tensor));
91+
}
92+
93+
TEST(BasicDatatypeIOTests, AssertSizesOfSizeTypesAreConsistent)
94+
{
95+
ASSERT_EQ(8, sizeof(SCIRun::size_type));
96+
ASSERT_EQ(8, sizeof(SCIRun::index_type));
97+
}

src/Interface/Application/ProvenanceWindow.ui

Lines changed: 99 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
<x>0</x>
88
<y>0</y>
99
<width>615</width>
10-
<height>450</height>
10+
<height>458</height>
1111
</rect>
1212
</property>
1313
<property name="minimumSize">
1414
<size>
1515
<width>555</width>
16-
<height>450</height>
16+
<height>458</height>
1717
</size>
1818
</property>
1919
<property name="windowTitle">
@@ -27,63 +27,6 @@
2727
</size>
2828
</property>
2929
<layout class="QGridLayout" name="gridLayout">
30-
<item row="1" column="0">
31-
<widget class="QSplitter" name="splitter">
32-
<property name="sizePolicy">
33-
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
34-
<horstretch>0</horstretch>
35-
<verstretch>0</verstretch>
36-
</sizepolicy>
37-
</property>
38-
<property name="minimumSize">
39-
<size>
40-
<width>531</width>
41-
<height>300</height>
42-
</size>
43-
</property>
44-
<property name="orientation">
45-
<enum>Qt::Horizontal</enum>
46-
</property>
47-
<widget class="QListWidget" name="provenanceListWidget_">
48-
<property name="minimumSize">
49-
<size>
50-
<width>200</width>
51-
<height>0</height>
52-
</size>
53-
</property>
54-
<property name="toolTip">
55-
<string>List of historical actions</string>
56-
</property>
57-
</widget>
58-
<widget class="QTextEdit" name="networkXMLTextEdit_">
59-
<property name="minimumSize">
60-
<size>
61-
<width>500</width>
62-
<height>342</height>
63-
</size>
64-
</property>
65-
<property name="toolTip">
66-
<string>Network XML as of this change</string>
67-
</property>
68-
<property name="readOnly">
69-
<bool>true</bool>
70-
</property>
71-
</widget>
72-
</widget>
73-
</item>
74-
<item row="4" column="0">
75-
<widget class="QPushButton" name="clearButton_">
76-
<property name="maximumSize">
77-
<size>
78-
<width>100</width>
79-
<height>16777215</height>
80-
</size>
81-
</property>
82-
<property name="text">
83-
<string>Clear</string>
84-
</property>
85-
</widget>
86-
</item>
8730
<item row="0" column="0">
8831
<layout class="QGridLayout" name="gridLayout_2">
8932
<property name="topMargin">
@@ -158,6 +101,103 @@
158101
</item>
159102
</layout>
160103
</item>
104+
<item row="1" column="0">
105+
<widget class="QSplitter" name="splitter">
106+
<property name="sizePolicy">
107+
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
108+
<horstretch>0</horstretch>
109+
<verstretch>0</verstretch>
110+
</sizepolicy>
111+
</property>
112+
<property name="minimumSize">
113+
<size>
114+
<width>531</width>
115+
<height>300</height>
116+
</size>
117+
</property>
118+
<property name="orientation">
119+
<enum>Qt::Horizontal</enum>
120+
</property>
121+
<widget class="QListWidget" name="provenanceListWidget_">
122+
<property name="minimumSize">
123+
<size>
124+
<width>200</width>
125+
<height>0</height>
126+
</size>
127+
</property>
128+
<property name="toolTip">
129+
<string>List of historical actions</string>
130+
</property>
131+
</widget>
132+
<widget class="QTextEdit" name="networkXMLTextEdit_">
133+
<property name="minimumSize">
134+
<size>
135+
<width>500</width>
136+
<height>342</height>
137+
</size>
138+
</property>
139+
<property name="toolTip">
140+
<string>Network XML as of this change</string>
141+
</property>
142+
<property name="readOnly">
143+
<bool>true</bool>
144+
</property>
145+
</widget>
146+
</widget>
147+
</item>
148+
<item row="5" column="0">
149+
<layout class="QGridLayout" name="gridLayout_3">
150+
<item row="0" column="2">
151+
<widget class="QLabel" name="label">
152+
<property name="text">
153+
<string>Items to keep in history:</string>
154+
</property>
155+
<property name="alignment">
156+
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
157+
</property>
158+
</widget>
159+
</item>
160+
<item row="0" column="0">
161+
<widget class="QPushButton" name="clearButton_">
162+
<property name="maximumSize">
163+
<size>
164+
<width>100</width>
165+
<height>16777215</height>
166+
</size>
167+
</property>
168+
<property name="text">
169+
<string>Clear</string>
170+
</property>
171+
</widget>
172+
</item>
173+
<item row="0" column="3">
174+
<widget class="QSpinBox" name="itemMaxSpinBox_">
175+
<property name="minimum">
176+
<number>0</number>
177+
</property>
178+
<property name="maximum">
179+
<number>999</number>
180+
</property>
181+
<property name="value">
182+
<number>10</number>
183+
</property>
184+
</widget>
185+
</item>
186+
<item row="0" column="1">
187+
<spacer name="horizontalSpacer">
188+
<property name="orientation">
189+
<enum>Qt::Horizontal</enum>
190+
</property>
191+
<property name="sizeHint" stdset="0">
192+
<size>
193+
<width>40</width>
194+
<height>20</height>
195+
</size>
196+
</property>
197+
</spacer>
198+
</item>
199+
</layout>
200+
</item>
161201
</layout>
162202
</widget>
163203
</widget>

src/Interface/Modules/Render/ViewScene.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ void ViewSceneDialog::buildGeometryClippingPlane(int index, glm::vec4 plane, con
12271227
renState.set(RenderState::USE_DEFAULT_COLOR, true);
12281228
renState.set(RenderState::USE_NORMALS, true);
12291229
renState.set(RenderState::IS_WIDGET, true);
1230-
GeometryHandle geom(new GeometryObjectSpire(*gid_, uniqueNodeID, false));
1230+
auto geom(boost::make_shared<GeometryObjectSpire>(*gid_, uniqueNodeID, false));
12311231
glyphs.buildObject(geom, uniqueNodeID, renState.get(RenderState::USE_TRANSPARENCY), 1.0,
12321232
colorScheme, renState, SpireIBO::PRIMITIVE::TRIANGLES, bbox);
12331233

@@ -1242,7 +1242,7 @@ void ViewSceneDialog::buildGeometryClippingPlane(int index, glm::vec4 plane, con
12421242
uniqueNodeID = ss.str();
12431243
renState.set(RenderState::USE_TRANSPARENCY, true);
12441244
renState.defaultColor = ColorRGB(1, 1, 1, 0.2);
1245-
GeometryHandle geom2(new GeometryObjectSpire(*gid_, ss.str(), false));
1245+
auto geom2(boost::make_shared<GeometryObjectSpire>(*gid_, ss.str(), false));
12461246
glyphs2.buildObject(geom2, uniqueNodeID, renState.get(RenderState::USE_TRANSPARENCY), 0.2,
12471247
colorScheme, renState, SpireIBO::PRIMITIVE::TRIANGLES, bbox);
12481248

src/Modules/Fields/EditMeshBoundingBox.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ GeometryBaseHandle EditMeshBoundingBox::buildGeometryObject()
278278
renState.set(RenderState::USE_NORMALS, true);
279279
renState.set(RenderState::IS_WIDGET, true);
280280

281-
GeometryHandle geom(new GeometryObjectSpire(*this, "BoundingBox", true));
281+
auto geom(boost::make_shared<GeometryObjectSpire>(*this, "BoundingBox", true));
282282

283283
glyphs.buildObject(geom, uniqueNodeID, renState.get(RenderState::USE_TRANSPARENCY), 1.0,
284284
colorScheme, renState, SpireIBO::PRIMITIVE::TRIANGLES, bbox_);

src/Modules/Legacy/Fields/GeneratePointSamplesFromField.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ FieldHandle GeneratePointSamplesFromField::GenerateOutputField()
291291

292292
GeometryHandle GeneratePointSamplesFromFieldImpl::buildWidgetObject(FieldHandle field, double radius, const GeometryIDGenerator& idGenerator)
293293
{
294-
GeometryHandle geom(new GeometryObjectSpire(idGenerator, "EntireSinglePointProbeFromField", true));
294+
auto geom(boost::make_shared<GeometryObjectSpire>(idGenerator, "EntireSinglePointProbeFromField", true));
295295

296-
VMesh* mesh = field->vmesh();
296+
auto mesh = field->vmesh();
297297

298298
ColorScheme colorScheme = ColorScheme::COLOR_UNIFORM;
299299
ColorRGB node_color;

src/Modules/Legacy/Fields/GenerateSinglePointProbeFromField.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ index_type GenerateSinglePointProbeFromField::GenerateIndex()
444444

445445
GeometryHandle GenerateSinglePointProbeFromFieldImpl::buildWidgetObject(FieldHandle field, ModuleStateHandle state, const GeometryIDGenerator& idGenerator)
446446
{
447-
GeometryHandle geom(new GeometryObjectSpire(idGenerator, "EntireSinglePointProbeFromField", true));
447+
auto geom(boost::make_shared<GeometryObjectSpire>(idGenerator, "EntireSinglePointProbeFromField", true));
448448

449449
auto mesh = field->vmesh();
450450

src/Modules/Visualization/ShowColorMapModule.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ GeometryBaseHandle ShowColorMap::buildGeometryObject(ColorMapHandle cm, ModuleSt
188188
// Add all uniforms generated above to the pass.
189189
for (const auto& uniform : uniforms) { pass.addUniform(uniform); }
190190

191-
GeometryHandle geom(new GeometryObjectSpire(*this, "ShowColorMap", false));
191+
auto geom(boost::make_shared<GeometryObjectSpire>(*this, "ShowColorMap", false));
192192

193193
geom->mColorMap = cm->getColorMapName();
194194
geom->mIBOs.push_back(geomIBO);

src/Modules/Visualization/ShowField.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ GeometryHandle GeometryBuilder::buildGeometryObject(
357357
idname = idname + "_" + state->getValue(ShowField::FieldName).toString();
358358
}
359359

360-
GeometryHandle geom(new GeometryObjectSpire(gid, idname, true));
360+
auto geom(boost::make_shared<GeometryObjectSpire>(gid, idname, true));
361361

362362
/// \todo Implement inputs_changes_ ? See old scirun ShowField.cc:293.
363363

src/Modules/Visualization/ShowFieldGlyphs.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ GeometryHandle GlyphBuilder::buildGeometryObject(
247247
bool showScalars = state->getValue(ShowFieldGlyphs::ShowScalars).toBool();
248248
bool showTensors = state->getValue(ShowFieldGlyphs::ShowTensors).toBool();
249249

250-
GeometryHandle geom(new GeometryObjectSpire(idgen, "EntireGlyphField", true));
250+
auto geom(boost::make_shared<GeometryObjectSpire>(idgen, "EntireGlyphField", true));
251251

252252
FieldInformation finfo(field);
253253

0 commit comments

Comments
 (0)