Skip to content

Commit fb03109

Browse files
authored
Merge branch 'master' into tensor_tests
2 parents 0b2596b + e10a8b7 commit fb03109

25 files changed

+3670
-3060
lines changed

src/Core/Algorithms/Visualization/RenderFieldState.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ class SCISHARE RenderState
102102
MAX_ACTION_FLAGS
103103
};
104104

105+
enum InputPort
106+
{
107+
PRIMARY_PORT,
108+
SECONDARY_PORT,
109+
TERTIARY_PORT
110+
};
111+
105112
enum GlyphType
106113
{
107114
POINT_GLYPH,
@@ -135,6 +142,12 @@ class SCISHARE RenderState
135142
bool mFlags[MAX_ACTION_FLAGS];
136143
TransparencySortType mSortType = CONTINUOUS_SORT;
137144
GlyphType mGlyphType = POINT_GLYPH;
145+
//InputPort mTransparencyInput = PRIMARY_PORT;
146+
InputPort mColorInput = PRIMARY_PORT;
147+
InputPort mSecondaryVectorParameterInput = PRIMARY_PORT;
148+
InputPort mSpringsMajorRadiusInput = PRIMARY_PORT;
149+
InputPort mSpringsMinorRadiusInput = PRIMARY_PORT;
150+
InputPort mSpringsPitchInput = PRIMARY_PORT;
138151

139152
Core::Datatypes::ColorRGB defaultColor;
140153
};

src/Core/GeometryPrimitives/Tensor.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,17 @@ double Tensor::norm() const
254254
return (a);
255255
}
256256

257+
double Tensor::magnitude()
258+
{
259+
double eigenval1, eigenval2, eigenval3;
260+
get_eigenvalues(eigenval1, eigenval2, eigenval3);
261+
262+
double magnitude = sqrt(eigenval1 * eigenval1 +
263+
eigenval2 * eigenval2 +
264+
eigenval3 * eigenval3);
265+
return magnitude;
266+
}
267+
257268
std::string Tensor::type_name(int) {
258269
static const std::string str("Tensor");
259270
return str;

src/Core/GeometryPrimitives/Tensor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class SCISHARE Tensor {
9797
void get_eigenvalues(double &l1, double &l2, double &l3);
9898

9999
double norm() const;
100+
double magnitude();
100101

101102
void set_eigens(const Vector &e1, const Vector &e2, const Vector &e3);
102103

src/ExampleNets/regression/tensorOrders.srn5

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,9 @@ RESULT = ten;</value>
677677
<name>TensorsColoring</name>
678678
<value>
679679
<which>2</which>
680+
680681
<value>Colormap Lookup</value>
682+
681683
</value>
682684
</second>
683685
</item>
@@ -1426,6 +1428,7 @@ RESULT = ten;</value>
14261428
</port2_>
14271429
</item>
14281430
<item>
1431+
14291432
<moduleId1_>GetFieldBoundary:8</moduleId1_>
14301433
<port1_>
14311434
<name>BoundaryField</name>
@@ -1435,6 +1438,7 @@ RESULT = ten;</value>
14351438
<port2_>
14361439
<name>Field</name>
14371440
<id>1</id>
1441+
14381442
</port2_>
14391443
</item>
14401444
<item>
@@ -1443,6 +1447,7 @@ RESULT = ten;</value>
14431447
<name>BoundaryField</name>
14441448
<id>0</id>
14451449
</port1_>
1450+
14461451
<moduleId2_>ShowFieldGlyphs:8</moduleId2_>
14471452
<port2_>
14481453
<name>PrimaryData</name>
@@ -1453,11 +1458,14 @@ RESULT = ten;</value>
14531458
<moduleId1_>RescaleColorMap:1</moduleId1_>
14541459
<port1_>
14551460
<name>ColorMapOutput</name>
1461+
14561462
<id>0</id>
14571463
</port1_>
14581464
<moduleId2_>ShowFieldGlyphs:8</moduleId2_>
14591465
<port2_>
1466+
14601467
<name>PrimaryColorMap</name>
1468+
14611469
<id>0</id>
14621470
</port2_>
14631471
</item>

src/Graphics/Glyphs/GlyphGeom.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,10 @@ void GlyphGeom::buildObject(GeometryObjectSpire& geom, const std::string& unique
202202
geom.passes().push_back(pass);
203203
}
204204

205-
void GlyphGeom::addArrow(const Point& p1, const Point& p2, double radius, double resolution,
205+
void GlyphGeom::addArrow(const Point& p1, const Point& p2, double radius, double ratio, double resolution,
206206
const ColorRGB& color1, const ColorRGB& color2)
207207
{
208-
double ratio = 0.5;
209-
210-
Point mid(ratio * (p1.x() + p2.x()), ratio * (p1.y() + p2.y()), ratio * (p1.z() + p2.z()));
208+
Point mid((p1.x() * ratio + p2.x() * (1 - ratio)), (p1.y() * ratio + p2.y() * (1 - ratio)), (p1.z() * ratio + p2.z() * (1 - ratio)));
211209

212210
generateCylinder(p1, mid, radius / 6.0, radius / 6.0, resolution, color1, color2);
213211
generateCylinder(mid, p2, radius, 0.0, resolution, color1, color2);

src/Graphics/Glyphs/GlyphGeom.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace SCIRun {
5353
const Datatypes::ColorScheme& colorScheme, RenderState state,
5454
const Datatypes::SpireIBO::PRIMITIVE& primIn, const Core::Geometry::BBox& bbox);
5555

56-
void addArrow(const Core::Geometry::Point& p1, const Core::Geometry::Point& p2, double radius, double resolution,
56+
void addArrow(const Core::Geometry::Point& p1, const Core::Geometry::Point& p2, double radius, double ratio, double resolution,
5757
const Core::Datatypes::ColorRGB& color1, const Core::Datatypes::ColorRGB& color2);
5858
void addSphere(const Core::Geometry::Point& p, double radius, double resolution, const Core::Datatypes::ColorRGB& color);
5959
void addBox(const Core::Geometry::Point& center, Core::Geometry::Tensor& t, double scale);

src/Interface/Modules/Visualization/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ SET(Interface_Modules_Visualization_FORMS
3232
GenerateStreamLines.ui
3333
ShowField.ui
3434
ShowFieldGlyphs.ui
35-
ShowFieldGlyphsScalarTab.ui
36-
ShowFieldGlyphsVectorTab.ui
37-
ShowFieldGlyphsTensorTab.ui
38-
ShowFieldGlyphsSecondaryTab.ui
3935
ShowString.ui
4036
ShowColorMap.ui
4137
RescaleColorMap.ui
@@ -48,9 +44,6 @@ SET(Interface_Modules_Visualization_HEADERS
4844
share.h
4945
ShowFieldDialog.h
5046
ShowFieldGlyphsDialog.h
51-
ShowFieldGlyphsScalarTabDialog.h
52-
ShowFieldGlyphsVectorTabDialog.h
53-
ShowFieldGlyphsTensorTabDialog.h
5447
ShowStringDialog.h
5548
ShowColorMapDialog.h
5649
RescaleColorMapDialog.h
@@ -62,9 +55,6 @@ SET(Interface_Modules_Visualization_SOURCES
6255
GenerateStreamLinesDialog.cc
6356
ShowFieldDialog.cc
6457
ShowFieldGlyphsDialog.cc
65-
ShowFieldGlyphsScalarTabDialog.cc
66-
ShowFieldGlyphsVectorTabDialog.cc
67-
ShowFieldGlyphsTensorTabDialog.cc
6858
ShowStringDialog.cc
6959
ShowColorMapDialog.cc
7060
RescaleColorMapDialog.cc

0 commit comments

Comments
 (0)