diff options
author | joye <joye> | 2014-03-31 19:11:42 (GMT) |
---|---|---|
committer | joye <joye> | 2014-03-31 19:11:42 (GMT) |
commit | 8150f1b6d516c20ed7bef75513d08a32a0c79eb0 (patch) | |
tree | 0bb11e253ae99cb3ed78393bd9a35df95f4ee0a4 /src/bltGrElemOp.C | |
parent | 009dc90739fa4380c5429231ef90d3c48947f12e (diff) | |
download | blt-8150f1b6d516c20ed7bef75513d08a32a0c79eb0.zip blt-8150f1b6d516c20ed7bef75513d08a32a0c79eb0.tar.gz blt-8150f1b6d516c20ed7bef75513d08a32a0c79eb0.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src/bltGrElemOp.C')
-rw-r--r-- | src/bltGrElemOp.C | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/bltGrElemOp.C b/src/bltGrElemOp.C index bd1a262..8625fd8 100644 --- a/src/bltGrElemOp.C +++ b/src/bltGrElemOp.C @@ -1140,88 +1140,6 @@ static void FindRange(ElemValues* valuesPtr) valuesPtr->max = max; } -double Blt_FindElemValuesMinimum(ElemValues* valuesPtr, double minLimit) -{ - double min = DBL_MAX; - if (!valuesPtr) - return min; - - for (int ii=0; ii<valuesPtr->nValues; ii++) { - double x = valuesPtr->values[ii]; - // What do you do about negative values when using log - // scale values seems like a grey area. Mirror. - if (x < 0.0) - x = -x; - if ((x > minLimit) && (min > x)) - min = x; - } - if (min == DBL_MAX) - min = minLimit; - - return min; -} - -void Blt_FreeStylePalette(Blt_Chain stylePalette) -{ - // Skip the first slot. It contains the built-in "normal" pen of the element - Blt_ChainLink link = Blt_Chain_FirstLink(stylePalette); - if (link) { - Blt_ChainLink next; - for (link = Blt_Chain_NextLink(link); link != NULL; link = next) { - next = Blt_Chain_NextLink(link); - PenStyle *stylePtr = (PenStyle*)Blt_Chain_GetValue(link); - Blt_FreePen(stylePtr->penPtr); - Blt_Chain_DeleteLink(stylePalette, link); - } - } -} - -PenStyle** Blt_StyleMap(Element* elemPtr) -{ - int i; - int nWeights; /* Number of weights to be examined. - * If there are more data points than - * weights, they will default to the - * normal pen. */ - Blt_ChainLink link; - double *w; /* Weight vector */ - int nPoints; - - nPoints = NUMBEROFPOINTS(elemPtr); - nWeights = MIN(elemPtr->w ? elemPtr->w->nValues : 0, nPoints); - w = elemPtr->w ? elemPtr->w->values : NULL; - link = Blt_Chain_FirstLink(elemPtr->stylePalette); - PenStyle *stylePtr = (PenStyle*)Blt_Chain_GetValue(link); - - /* - * Create a style mapping array (data point index to style), - * initialized to the default style. - */ - PenStyle **dataToStyle = (PenStyle**)malloc(nPoints * sizeof(PenStyle *)); - for (i = 0; i < nPoints; i++) - dataToStyle[i] = stylePtr; - - for (i = 0; i < nWeights; i++) { - for (link = Blt_Chain_LastLink(elemPtr->stylePalette); link != NULL; - link = Blt_Chain_PrevLink(link)) { - stylePtr = (PenStyle*)Blt_Chain_GetValue(link); - - if (stylePtr->weight.range > 0.0) { - double norm; - - norm = (w[i] - stylePtr->weight.min) / stylePtr->weight.range; - if (((norm - 1.0) <= DBL_EPSILON) && - (((1.0 - norm) - 1.0) <= DBL_EPSILON)) { - dataToStyle[i] = stylePtr; - break; /* Done: found range that matches. */ - } - } - } - } - return dataToStyle; -} - - static int GetIndex(Tcl_Interp* interp, Element* elemPtr, Tcl_Obj *objPtr, int *indexPtr) { |