Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Transfunc Class Reference

#include <transfunc.h>

List of all members.

Public Methods

 Transfunc ()
 Transfunc (const Transfunc &trans)
 ~Transfunc ()
bool SetDensityColor (int dens, rgb col)
rgb GetDensityColor (int dens)
bool SetOpacity (int dens, float opac)
float GetOpacity (int dens)

Private Attributes

rgbcolormap
float * opacitymap


Constructor & Destructor Documentation

Transfunc::Transfunc  
 

Definition at line 4 of file transfunc.cpp.

References rgb::b, colormap, rgb::g, opacitymap, and rgb::r.

00005 {
00006         opacitymap = new float[4096];
00007         colormap = new rgb[4096];
00008         for(int i = 0; i < 4096; i++) 
00009         {
00010                 opacitymap[i] = 0.0;
00011                 colormap[i].r = 0;
00012                 colormap[i].g = 0;
00013                 colormap[i].b = 0;
00014         }
00015 }

Transfunc::Transfunc const Transfunc &    trans
 

Definition at line 18 of file transfunc.cpp.

References colormap, and opacitymap.

00018                                            {
00019         if (!colormap)
00020                 colormap = new rgb[4096];
00021         if (!opacitymap)
00022                 opacitymap = new float[4096];
00023 
00024 
00025         for (int i = 0; i < 4096; i++) {
00026                 colormap[i] = trans.colormap[i];
00027                 opacitymap[i] = trans.opacitymap[i];
00028         }
00029 }

Transfunc::~Transfunc  
 

Definition at line 32 of file transfunc.cpp.

References colormap, and opacitymap.

00033 {
00034         if(colormap != NULL) {
00035                 delete[] colormap;
00036                 colormap = NULL;
00037         }
00038         if(opacitymap != NULL) {
00039                 delete[] opacitymap;
00040                 opacitymap = NULL;
00041         }
00042 }


Member Function Documentation

rgb Transfunc::GetDensityColor int    dens
 

Definition at line 45 of file transfunc.cpp.

References colormap.

Referenced by Trilinear::CalcColorTrilinear(), AverageTRI::CastNext(), AverageNN::CastNext(), XRayTRI::CastNext(), XRayNN::CastNext(), MaxIntensityTRI::CastNext(), MaxIntensityNN::CastNext(), FirstHitNN::CastNext(), and Ray::CastNext().

00046 {
00047         if (dens > 4095)
00048                 dens = 4095;
00049 
00050         return colormap[dens];
00051 }

float Transfunc::GetOpacity int    dens
 

Definition at line 63 of file transfunc.cpp.

References opacitymap.

Referenced by Trilinear::CalcAlphaTrilinear(), AverageTRI::CastNext(), AverageNN::CastNext(), XRayTRI::CastNext(), XRayNN::CastNext(), MaxIntensityTRI::CastNext(), MaxIntensityNN::CastNext(), FirstHitNN::CastNext(), and Ray::CastNext().

00064 {
00065         if (dens > 4095)
00066                 dens = 4095;
00067 
00068         if (dens < 0)
00069                 dens = 0;
00070 
00071         return opacitymap[dens];
00072 }

bool Transfunc::SetDensityColor int    dens,
rgb    col
 

Definition at line 54 of file transfunc.cpp.

References rgb::b, colormap, rgb::g, and rgb::r.

Referenced by CMy3dvisApp::m_BuildTransferFunction().

00055 {
00056         colormap[dens].r = col.r;
00057         colormap[dens].g = col.g;
00058         colormap[dens].b = col.b;
00059         return true;
00060 }

bool Transfunc::SetOpacity int    dens,
float    opac
 

Definition at line 75 of file transfunc.cpp.

References opacitymap.

Referenced by CMy3dvisApp::m_BuildTransferFunction().

00076 {
00077         opacitymap[dens] = opac;
00078         return true;
00079 }


Member Data Documentation

rgb* Transfunc::colormap [private]
 

Definition at line 23 of file transfunc.h.

Referenced by GetDensityColor(), SetDensityColor(), Transfunc(), and ~Transfunc().

float* Transfunc::opacitymap [private]
 

Definition at line 24 of file transfunc.h.

Referenced by GetOpacity(), SetOpacity(), Transfunc(), and ~Transfunc().


The documentation for this class was generated from the following files:
Generated on Thu Jan 23 12:32:17 2003 by doxygen1.3-rc2