Skip to content

Commit 6eddae6

Browse files
committed
Merge branch 'master' into modules_V
2 parents 18859b9 + 53df379 commit 6eddae6

File tree

21 files changed

+1954
-1124
lines changed

21 files changed

+1954
-1124
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ SET_PROPERTY(TARGET Core_Application PROPERTY FOLDER "Core")
729729
SET_PROPERTY(TARGET Core_Application_Preferences PROPERTY FOLDER "Core")
730730
SET_PROPERTY(TARGET Core_Application_Session PROPERTY FOLDER "Core")
731731
SET_PROPERTY(TARGET Core_Utils PROPERTY FOLDER "Core")
732+
SET_PROPERTY(TARGET Core_ICom PROPERTY FOLDER "Core")
733+
SET_PROPERTY(TARGET Core_Services PROPERTY FOLDER "Core")
732734
SET_PROPERTY(TARGET Core_Math PROPERTY FOLDER "Core")
733735
SET_PROPERTY(TARGET Core_Matlab PROPERTY FOLDER "Core")
734736
SET_PROPERTY(TARGET Core_Parser PROPERTY FOLDER "Core")

src/Core/Datatypes/Color.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,21 @@
3636
using namespace SCIRun::Core::Datatypes;
3737

3838
ColorRGB::ColorRGB()
39-
: r_(1.0), g_(1.0), b_(1.0)
39+
: r_(1.0), g_(1.0), b_(1.0), a_(1.0)
4040
{
4141
}
4242

4343
ColorRGB::ColorRGB(double r, double g, double b)
44-
: r_(r), g_(g), b_(b)
44+
: r_(r), g_(g), b_(b), a_(1.0)
4545
{
4646
}
4747

48-
ColorRGB::ColorRGB(const std::string& rgb) : r_(1.0), g_(1.0), b_(1.0)
48+
ColorRGB::ColorRGB(double r, double g, double b, double a)
49+
: r_(r), g_(g), b_(b), a_(a)
50+
{
51+
}
52+
53+
ColorRGB::ColorRGB(const std::string& rgb) : r_(1.0), g_(1.0), b_(1.0), a_(1.0)
4954
{
5055
try
5156
{

src/Core/Datatypes/Color.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,16 @@ namespace Datatypes {
4242
class SCISHARE ColorRGB
4343
{
4444
private:
45-
double r_, g_, b_;
45+
double r_, g_, b_, a_;
4646
public:
4747
ColorRGB();
4848
explicit ColorRGB(const std::string& rgb);
4949
ColorRGB(double r, double g, double b);
50+
ColorRGB(double r, double g, double b, double a);
5051

5152
// These equality operations should use floating point comparisons.
5253
inline bool operator==(const ColorRGB& c) const {
53-
return ((r_==c.r_)&&(g_==c.g_)&&(b_==c.b_));
54+
return ((r_==c.r_)&&(g_==c.g_)&&(b_==c.b_)&&(a_==c.a_));
5455
}
5556

5657
inline bool operator!=(const ColorRGB& c) const {
@@ -63,6 +64,7 @@ namespace Datatypes {
6364
inline double r() const {return r_;}
6465
inline double g() const {return g_;}
6566
inline double b() const {return b_;}
67+
inline double a() const {return a_;}
6668

6769
std::string toString() const;
6870
};

src/Core/Datatypes/ColorMap.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,12 @@ ColorRGB ColorMap::valueToColor(double scalar) const {
173173
*/
174174
ColorRGB ColorMap::valueToColor(const Tensor &tensor) const {
175175
//TODO this is probably not implemented correctly.
176-
return ColorRGB(getTransformedColor(fabs(tensor.xx())),
177-
getTransformedColor(fabs(tensor.yy())),
178-
getTransformedColor(fabs(tensor.zz())));
176+
//return ColorRGB(getTransformedColor(fabs(tensor.xx())), getTransformedColor(fabs(tensor.yy())), getTransformedColor(fabs(tensor.zz())));
177+
double eigen1, eigen2, eigen3;
178+
Tensor ten = tensor;
179+
ten.get_eigenvalues(eigen1, eigen2, eigen3);
180+
double primaryEigen = std::max(std::max(eigen1, eigen2), eigen3);
181+
return getColorMapVal(primaryEigen);
179182
}
180183
/**
181184
* @name valueToColor
@@ -185,10 +188,8 @@ ColorRGB ColorMap::valueToColor(const Tensor &tensor) const {
185188
*/
186189
ColorRGB ColorMap::valueToColor(const Vector &vector) const {
187190
//TODO this is probably not implemented correctly.
188-
return ColorRGB(getTransformedColor(fabs(vector.x())),
189-
getTransformedColor(fabs(vector.y())),
190-
getTransformedColor(fabs(vector.z())));
191-
191+
// return ColorRGB(getTransformedColor(fabs(vector.x())),getTransformedColor(fabs(vector.y())), getTransformedColor(fabs(vector.z())));
192+
return getColorMapVal(vector.length());
192193
}
193194

194195
std::string ColorMap::getColorMapName() const { return name_; }

0 commit comments

Comments
 (0)