summaryrefslogtreecommitdiffstats
path: root/tksao/colorbar/colormap.C
blob: 4baf79e61fe6aa9f957d31a50e9e4ac3959aaf1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (C) 1999-2017
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"

#include "colormap.h"
#include "util.h"

static int squenceID = 1;

// ColorMapInfo

ColorMapInfo::ColorMapInfo(Colorbar* p) : parent_(p)
{
  id = squenceID++;
  name =NULL;
  fileName =NULL;
  next_ =NULL;
  previous_ =NULL;
}

ColorMapInfo::~ColorMapInfo()
{
  if (name)
    delete [] name;

  if (fileName)
    delete [] fileName;
}

void ColorMapInfo::setName(const char* n)
{
  if (name)
    delete [] name;

  name = dupstr(n);
}

void ColorMapInfo::setFileName(const char* n)
{
  if (fileName)
    delete [] fileName;

  fileName = dupstr(n);
}