summaryrefslogtreecommitdiffstats
path: root/src/bltGrElem.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/bltGrElem.C')
-rw-r--r--src/bltGrElem.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/bltGrElem.C b/src/bltGrElem.C
index 6414c4a..7754b3e 100644
--- a/src/bltGrElem.C
+++ b/src/bltGrElem.C
@@ -27,6 +27,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#include <math.h>
#include <float.h>
#include <stdlib.h>
@@ -37,6 +38,8 @@
using namespace Blt;
+// Class ElemValues
+
ElemValues::ElemValues()
{
type = SOURCE_VALUES;
@@ -54,6 +57,25 @@ ElemValues::~ElemValues()
delete [] values;
}
+void ElemValues::findRange()
+{
+ if (nValues<1 || !values)
+ return;
+
+ min = DBL_MAX;
+ max = -DBL_MAX;
+ for (int ii=0; ii<nValues; ii++) {
+ if (isfinite(values[ii])) {
+ if (values[ii] < min)
+ min = values[ii];
+ if (values[ii] > max)
+ max = values[ii];
+ }
+ }
+}
+
+// Class Element
+
Element::Element(Graph* graphPtr, const char* name, Tcl_HashEntry* hPtr)
{
graphPtr_ = graphPtr;