From ca9f9a5e75e20cd2a842acf29f5cafb562b7f293 Mon Sep 17 00:00:00 2001 From: joye Date: Mon, 7 Jul 2014 18:04:57 +0000 Subject: *** empty log message *** --- src/bltGrElem.C | 16 ++++++++++++++++ src/bltGrElem.h | 26 ++++++++++++++++++++------ src/bltGrElemOption.C | 15 ++++++++------- 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/src/bltGrElem.C b/src/bltGrElem.C index 7754b3e..d173c14 100644 --- a/src/bltGrElem.C +++ b/src/bltGrElem.C @@ -74,6 +74,22 @@ void ElemValues::findRange() } } +ElemValuesSource::ElemValuesSource() +{ +} + +ElemValuesSource::~ElemValuesSource() +{ +} + +ElemValuesVector::ElemValuesVector() +{ +} + +ElemValuesVector::~ElemValuesVector() +{ +} + // Class Element Element::Element(Graph* graphPtr, const char* name, Tcl_HashEntry* hPtr) diff --git a/src/bltGrElem.h b/src/bltGrElem.h index 5b50542..042f6cd 100644 --- a/src/bltGrElem.h +++ b/src/bltGrElem.h @@ -59,12 +59,6 @@ namespace Blt { class Postscript; typedef struct { - Segment2d *segments; - int *map; - int length; - } GraphSegments; - - typedef struct { Blt_VectorId vector; } VectorDataSource; @@ -88,6 +82,26 @@ namespace Blt { void findRange(); }; + class ElemValuesSource : public ElemValues + { + public: + ElemValuesSource(); + ~ElemValuesSource(); + }; + + class ElemValuesVector : public ElemValues + { + public: + ElemValuesVector(); + ~ElemValuesVector(); + }; + + typedef struct { + Segment2d *segments; + int *map; + int length; + } GraphSegments; + typedef struct { ElemValues* x; ElemValues* y; diff --git a/src/bltGrElemOption.C b/src/bltGrElemOption.C index 379c909..1880e0c 100644 --- a/src/bltGrElemOption.C +++ b/src/bltGrElemOption.C @@ -91,17 +91,18 @@ static int ValuesSetProc(ClientData clientData, Tcl_Interp* interp, return TCL_OK; } - ElemValues* valuesPtr = new ElemValues(); - valuesPtr->elemPtr = elemPtr; - const char *string = Tcl_GetString(objv[0]); if ((objc == 1) && (Blt_VectorExists2(interp, string))) { + ElemValuesVector* valuesPtr = new ElemValuesVector(); + valuesPtr->elemPtr = elemPtr; valuesPtr->type = ElemValues::SOURCE_VECTOR; - if (GetVectorData(interp, valuesPtr, string) != TCL_OK) return TCL_ERROR; + *valuesPtrPtr = valuesPtr; } else { + ElemValuesSource* valuesPtr = new ElemValuesSource(); + valuesPtr->elemPtr = elemPtr; valuesPtr->type = ElemValues::SOURCE_VALUES; double* values; @@ -111,9 +112,9 @@ static int ValuesSetProc(ClientData clientData, Tcl_Interp* interp, valuesPtr->values = values; valuesPtr->nValues = nValues; valuesPtr->findRange(); + *valuesPtrPtr = valuesPtr; } - *valuesPtrPtr = valuesPtr; return TCL_OK; } @@ -203,8 +204,8 @@ static int PairsSetProc(ClientData clientData, Tcl_Interp* interp, if (newSize == 0) return TCL_OK; - coordsPtr->x = new ElemValues(); - coordsPtr->y = new ElemValues(); + coordsPtr->x = new ElemValuesSource(); + coordsPtr->y = new ElemValuesSource(); coordsPtr->x->values = new double[newSize]; coordsPtr->x->nValues = nValues; -- cgit v0.12