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.cpp implementiert ein Mapping zwischen Dichtewert und Farbe bzw. Opazität

 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  
 

transfunc.cpp implementiert ein Mapping zwischen Dichtewert und Farbe bzw. Opazität

Definition at line 5 of file transfunc.cpp.

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

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

Transfunc::Transfunc const Transfunc &    trans
 

Definition at line 19 of file transfunc.cpp.

References colormap, and opacitymap.

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

Transfunc::~Transfunc  
 

Definition at line 33 of file transfunc.cpp.

References colormap, and opacitymap.

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


Member Function Documentation

rgb Transfunc::GetDensityColor int    dens
 

Definition at line 46 of file transfunc.cpp.

References colormap.

Referenced by Trilinear::CalcColorTrilinear(), MaxIntensityTRI::CastNext(), MaxIntensityNN::CastNext(), FirstHitNN::CastNext(), and Ray::CastNext().

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

float Transfunc::GetOpacity int    dens
 

Definition at line 64 of file transfunc.cpp.

References opacitymap.

Referenced by Trilinear::CalcAlphaTrilinear(), MaxIntensityTRI::CastNext(), MaxIntensityNN::CastNext(), FirstHitNN::CastNext(), and Ray::CastNext().

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

bool Transfunc::SetDensityColor int    dens,
rgb    col
 

Definition at line 55 of file transfunc.cpp.

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

Referenced by CMy3dvisApp::m_BuildTransferFunction().

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

bool Transfunc::SetOpacity int    dens,
float    opac
 

Definition at line 76 of file transfunc.cpp.

References opacitymap.

Referenced by CMy3dvisApp::m_BuildTransferFunction().

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


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 30 21:35:44 2003 for 3DVis by doxygen1.3-rc2