Changeset 2148


Ignore:
Timestamp:
02/21/07 20:14:45 (17 years ago)
Author:
bittner
Message:

rainbow color maps

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Makefile

    r2105 r2148  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.2) on: ?t 8. II 14:44:05 2007 
     3# Generated by qmake (2.00a) (Qt 4.1.2) on: út 20. II 20:32:50 2007 
    44# Project:  preprocessor.pro 
    55# Template: app 
     
    6363        $(MAKE) -f $(MAKEFILE).Debug uninstall 
    6464 
    65 Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc2005\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 
     65Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc.net\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 
    6666                C:\Qt\4.1.2\mkspecs\features\qt_config.prf \ 
    6767                C:\Qt\4.1.2\mkspecs\features\exclusive_builds.prf \ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Material.cpp

    r863 r2148  
    2626} 
    2727 
     28 
     29 
     30RgbColor 
     31RainbowColorMapping(const float _value) 
     32{ 
     33  RgbColor color; 
     34 
     35  float value = 1.0f - _value; 
     36 
     37#define MAX_COLOR_VALUE 1.0f 
     38   
     39  switch ((int)(value*4.0f)) { 
     40  case 0: 
     41        color.r = MAX_COLOR_VALUE; 
     42        color.g = value*MAX_COLOR_VALUE; 
     43        color.b = 0.0f; 
     44        break; 
     45  case 1: 
     46        color.r = (1.0f - value)*MAX_COLOR_VALUE;; 
     47        color.g = MAX_COLOR_VALUE; 
     48        color.b = 0.0f; 
     49        break; 
     50  case 2: 
     51        color.r = 0.0f; 
     52        color.g = MAX_COLOR_VALUE; 
     53        color.b = value*MAX_COLOR_VALUE; 
     54        break; 
     55  case 3: 
     56        color.r = 0.0f; 
     57        color.g = (1.0f - value)*MAX_COLOR_VALUE;; 
     58        color.b = MAX_COLOR_VALUE; 
     59        break; 
     60  default: 
     61        color.r = value*MAX_COLOR_VALUE; 
     62        color.g = 0.0f; 
     63        color.b = MAX_COLOR_VALUE; 
     64        break; 
     65  } 
     66  return color; 
    2867} 
     68 
     69RgbColor 
     70GreenRedColorMap(const float value) 
     71{ 
     72  RgbColor color; 
     73   
     74#define MAX_COLOR_VALUE 1.0f 
     75   
     76  color.r = MAX_COLOR_VALUE*value; 
     77  color.g = MAX_COLOR_VALUE*(1.0f - value); 
     78  color.b = 0.0f; 
     79   
     80  return color; 
     81} 
     82 
     83 
     84} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Material.h

    r1001 r2148  
    2323  RandomColor(const float a=0.0f, const float b=1.0f); 
    2424 
     25  // Mapping from interval 0.0-1.0 to RGB using "rainbow" color map 
     26  // (range of hue from 0-240) 
     27 
     28  friend RgbColor RainbowMapping(const float value); 
     29   
    2530}; 
    2631 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2147 r2148  
    1414#include "Trackball.h" 
    1515#include "QtPreprocessorThread.h" 
     16#include "Material.h" 
    1617 
    1718#define USE_CG 1 
     
    414415                 
    415416                if (mRenderVisibilityEstimates) { 
    416                   float visibility = mTransferFunction*log10(entry.mData.mSumPdf + 1); // /5.0f 
    417                   glColor3f(visibility, 0.0f, 0.0f); 
     417                  //float visibility = mTransferFunction*log10(entry.mData.mSumPdf + 1); // /5.0f 
     418                  //              glColor3f(visibility, 0.0f, 0.0f); 
     419 
     420                  RgbColor color = RainbowMapping(mTransferFunction*log10(entry.mData.mSumPdf + 1)); 
     421                  glColor3f(color.r, color.g, color.b); 
     422                   
    418423                  mUseForcedColors = true; 
    419424                  RenderIntersectable(object); 
     
    10501055          const float importance = 5.0f*mTransferFunction * 
    10511056                ((float)vc->GetPvs().GetSize() / (float)maxPvs); 
    1052           c = RgbColor(importance, 1.0f - importance, 0.0f); 
     1057          //      c = RgbColor(importance, 1.0f - importance, 0.0f); 
     1058          c = RainbowMapping(importance); 
     1059           
    10531060        } 
    10541061        glColor3f(c.r, c.g, c.b); 
     
    11251132  vl->addWidget(slider); 
    11261133  slider->show(); 
    1127   slider->setRange(1, 1000); 
     1134  slider->setRange(1, 10000); 
    11281135  slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 
    11291136  slider->setValue(100); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro

    r2105 r2148  
    9797UnigraphicsParser.cpp X3dExporter.cpp SceneGraph.cpp Material.cpp \ 
    9898Matrix4x4.cpp Vector3.cpp AxisAlignedBox3.cpp Ray.cpp main.cpp Mesh.cpp \ 
    99 Exporter.cpp Camera.cpp X3dParser.cpp MeshKdTree.cpp Pvs.cpp \ 
     99Exporter.cpp Camera.cpp X3dParser.cpp MeshKdTree.cpp \ 
    100100MutualVisibility.cpp Triangle3.cpp Rectangle3.cpp Plane3.cpp Polygon3.cpp \ 
    101101ViewCell.cpp ViewCellBsp.cpp Halton.cpp VssRay.cpp VssTree.cpp VssPreprocessor.cpp \ 
     
    116116RenderTexture.cpp Mutation.cpp Timer/RDTSCTimer.cpp \ 
    117117Timer/BenchTimer.cpp Timer/merror.cpp \ 
    118 Intersectable.cpp TraversalTree.cpp 
     118Intersectable.cpp TraversalTree.cpp ObjectPvs.cpp ObjectsParser.cpp 
     119 
    119120 
    120121SOURCES += BoostPreprocessorThread.cpp  
Note: See TracChangeset for help on using the changeset viewer.