summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjoye <joye>2014-07-07 18:04:57 (GMT)
committerjoye <joye>2014-07-07 18:04:57 (GMT)
commitca9f9a5e75e20cd2a842acf29f5cafb562b7f293 (patch)
tree2236964bdbbd8dcbbc67d9a970f550d2c752b671 /src
parent039a6a6e70aa246f355618a651fde68420250a99 (diff)
downloadblt-ca9f9a5e75e20cd2a842acf29f5cafb562b7f293.zip
blt-ca9f9a5e75e20cd2a842acf29f5cafb562b7f293.tar.gz
blt-ca9f9a5e75e20cd2a842acf29f5cafb562b7f293.tar.bz2
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/bltGrElem.C16
-rw-r--r--src/bltGrElem.h26
-rw-r--r--src/bltGrElemOption.C15
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;