ATLAS Offline Software
Loading...
Searching...
No Matches
VP1Color Class Reference

#include <VP1Color.h>

Collaboration diagram for VP1Color:

Static Public Member Functions

static float getValFromRGB (const int rgb)
static void setColorFromRGB (SoMaterial *mat, const std::string &type, const int r, const int g, const int b)

Detailed Description

Definition at line 12 of file VP1Color.h.

Member Function Documentation

◆ getValFromRGB()

float VP1Color::getValFromRGB ( const int rgb)
inlinestatic

Definition at line 16 of file VP1Color.h.

17{
18 return rgb/255.0;
19}

◆ setColorFromRGB()

void VP1Color::setColorFromRGB ( SoMaterial * mat,
const std::string & type,
const int r,
const int g,
const int b )
inlinestatic

Definition at line 21 of file VP1Color.h.

22{
23 const float fr = getValFromRGB(r);
24 const float fg = getValFromRGB(g);
25 const float fb = getValFromRGB(b);
26 if (type == "ambient")
27 mat->ambientColor.setValue(fr, fg, fb);
28 else if (type == "diffuse")
29 mat->diffuseColor.setValue(fr, fg, fb);
30 else if (type == "specular")
31 mat->specularColor.setValue(fr, fg, fb);
32 else if (type == "emissive")
33 mat->emissiveColor.setValue(fr, fg, fb);
34 else
35 std::cout << "ERROR! Color type not supported ==> " << type << std::endl;
36
37 // Debug Msg
38 //std::cout << "Set color (" << r << "," << g << "," << b << ") to (" << fr << "," << fg << "," << fb << ")" << std::endl;
39 return;
40}
static float getValFromRGB(const int rgb)
Definition VP1Color.h:16
int r
Definition globals.cxx:22

The documentation for this class was generated from the following file: