diff options
author | joye <joye> | 2014-07-07 19:44:22 (GMT) |
---|---|---|
committer | joye <joye> | 2014-07-07 19:44:22 (GMT) |
commit | 10c37eda06bed742efb7981146519105dc9def5c (patch) | |
tree | 06d82a70573cfb0bbfd0d814a23dfbde17cd721a /src | |
parent | 267555b1b725c8ea20cff33f525ea3046a35cf74 (diff) | |
download | blt-10c37eda06bed742efb7981146519105dc9def5c.zip blt-10c37eda06bed742efb7981146519105dc9def5c.tar.gz blt-10c37eda06bed742efb7981146519105dc9def5c.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r-- | src/bltGrElem.C | 22 | ||||
-rw-r--r-- | src/bltGrElem.h | 6 | ||||
-rw-r--r-- | src/bltGrElemOption.C | 2 |
3 files changed, 18 insertions, 12 deletions
diff --git a/src/bltGrElem.C b/src/bltGrElem.C index a386362..dd683fa 100644 --- a/src/bltGrElem.C +++ b/src/bltGrElem.C @@ -54,6 +54,16 @@ ElemValues::~ElemValues() delete [] values_; } +void ElemValues::reset() +{ + if (values_) + delete [] values_; + values_ =NULL; + nValues_ =0; + min_ =0; + max_ =0; +} + ElemValuesSource::ElemValuesSource(int nn) : ElemValues() { nValues_ = nn; @@ -97,10 +107,10 @@ ElemValuesVector::ElemValuesVector(Element* ptr, const char* vecName) ElemValuesVector::~ElemValuesVector() { - FreeVectorSource(); + freeSource(); } -int ElemValuesVector::GetVectorData() +int ElemValuesVector::getVector() { Graph* graphPtr = elemPtr_->graphPtr_; @@ -108,8 +118,8 @@ int ElemValuesVector::GetVectorData() if (Blt_GetVectorById(graphPtr->interp_, source_.vector, &vecPtr) != TCL_OK) return TCL_ERROR; - if (FetchVectorValues(vecPtr) != TCL_OK) { - FreeVectorSource(); + if (fetchValues(vecPtr) != TCL_OK) { + freeSource(); return TCL_ERROR; } @@ -117,7 +127,7 @@ int ElemValuesVector::GetVectorData() return TCL_OK; } -int ElemValuesVector::FetchVectorValues(Blt_Vector* vector) +int ElemValuesVector::fetchValues(Blt_Vector* vector) { Graph* graphPtr = elemPtr_->graphPtr_; @@ -147,7 +157,7 @@ int ElemValuesVector::FetchVectorValues(Blt_Vector* vector) return TCL_OK; } -void ElemValuesVector::FreeVectorSource() +void ElemValuesVector::freeSource() { if (source_.vector) { Blt_SetVectorChangedProc(source_.vector, NULL, NULL); diff --git a/src/bltGrElem.h b/src/bltGrElem.h index a1e7084..2c980f2 100644 --- a/src/bltGrElem.h +++ b/src/bltGrElem.h @@ -58,10 +58,6 @@ namespace Blt { class Pen; class Postscript; - typedef struct { - Blt_VectorId vector; - } VectorDataSource; - class ElemValues { public: double* values_; @@ -90,7 +86,7 @@ namespace Blt { { public: Element* elemPtr_; - VectorDataSource source_; + Blt_VectorId source_; public: ElemValuesVector(Element*, const char*); diff --git a/src/bltGrElemOption.C b/src/bltGrElemOption.C index 3a877fb..04dd669 100644 --- a/src/bltGrElemOption.C +++ b/src/bltGrElemOption.C @@ -356,7 +356,7 @@ void VectorChangedProc(Tcl_Interp* interp, ClientData clientData, } else { Blt_Vector* vector; - Blt_GetVectorById(interp, valuesPtr->source_.vector, &vector); + Blt_GetVectorById(interp, valuesPtr->source_, &vector); if (valuesPtr->fetchValues(vector) != TCL_OK) return; } |