summaryrefslogtreecommitdiffstats
path: root/tksao/frame/raytrace.C
blob: cd2e0309fcae08a1eb9bdb97a9e425d74153e732 (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
45
46
47
48
49
50
51
52
53
// Copyright (C) 1999-2017
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"

#include <string.h>

#include "raytrace.h"

RayTrace::RayTrace()
{
  az_ =0;
  el_ =0;
  width_ =0;
  height_ =0;
  zbuf_ =NULL;
  mkzbuf_ =NULL;

  next_ =NULL;
  previous_ =NULL;
}

RayTrace::RayTrace(double az, double el, int width, int height, 
		   Matrix3d mm, BBox3d bb)
{
  az_ = az;
  el_ = el;
  width_ = width;
  height_ = height;
  mm_ = mm;
  bb_ = bb;

  zbuf_ = new float[width_*height_];
  if (!zbuf_) 
    return;
  memset(zbuf_, 0, width_*height_*sizeof(float));

  mkzbuf_ = new unsigned char[width_*height_];
  if (!mkzbuf_)
    return;
  memset(mkzbuf_, 0, width_*height_);

  next_ =NULL;
  previous_ =NULL;
}

RayTrace::~RayTrace()
{
  if (zbuf_)
    delete [] zbuf_;
  if (mkzbuf_)
    delete [] mkzbuf_;
}