#include <VisAttributes.h>
Definition at line 14 of file VisAttributes.h.
◆ VisAttributes() [1/2]
VisAttributes::VisAttributes |
( |
| ) |
|
◆ VisAttributes() [2/2]
◆ ~VisAttributes()
VisAttributes::~VisAttributes |
( |
| ) |
|
|
virtual |
◆ add()
void VisAttributes::add |
( |
const std::string & |
name, |
|
|
SoMaterial * |
material |
|
) |
| |
|
protected |
Definition at line 122 of file VisAttributes.cxx.
124 std::cout<<
"VisAttributes::add ERROR: Material " <<
name<<
" already added!"<<std::endl;
129 if (material->transparency.getNum()!=1)
130 std::cout<<
"VisAttributes::add Warning: Found #transparency values different from 1 in material "<<
name<<std::endl;
◆ applyState()
void VisAttributes::applyState |
( |
QByteArray |
ba | ) |
|
Definition at line 61 of file VisAttributes.cxx.
64 QMap<QString,QByteArray> storedstates;
66 buffer.open(QIODevice::ReadOnly);
67 QDataStream state(&
buffer);
72 state >> storedstates;
78 QMap<QString,QByteArray>::const_iterator
it,
itE(storedstates.constEnd());
79 for (
it = storedstates.constBegin();
it!=
itE; ++
it) {
80 itMat =
m_d->
_map.find(
it.key().toStdString());
82 QByteArray
b(
it.value());
◆ get()
SoMaterial * VisAttributes::get |
( |
const std::string & |
name | ) |
const |
◆ getState()
QByteArray VisAttributes::getState |
( |
bool |
onlyChangedMaterials = true | ) |
|
Definition at line 32 of file VisAttributes.cxx.
36 if (onlyChangedMaterials) {
37 QMap<QString,QByteArray>::const_iterator
it,
itE(statesnow.constEnd());
38 QMap<QString,QByteArray>::const_iterator itOrig, itOrigE(
m_d->
initialState.constEnd());
39 for (
it = statesnow.constBegin();
it!=
itE; ++
it) {
41 if (itOrig==itOrigE||
it.value()!=itOrig.value())
42 storedstates.insert(
it.key(),
it.value());
45 storedstates = statesnow;
50 QBuffer
buffer(&byteArray);
51 buffer.open(QIODevice::WriteOnly);
◆ getValFromRGB()
float VisAttributes::getValFromRGB |
( |
const int |
rgb | ) |
|
|
private |
◆ init()
void VisAttributes::init |
( |
| ) |
|
◆ operator=()
◆ overrideTransparencies()
void VisAttributes::overrideTransparencies |
( |
float |
transpfact | ) |
|
◆ setColorFromRGB()
void VisAttributes::setColorFromRGB |
( |
SoMaterial * |
mat, |
|
|
const std::string & |
type, |
|
|
const int |
r, |
|
|
const int |
g, |
|
|
const int |
b |
|
) |
| |
|
protected |
Definition at line 149 of file VisAttributes.cxx.
154 if (
type ==
"ambient")
155 mat->ambientColor.setValue(
fr, fg, fb);
156 else if (
type ==
"diffuse")
157 mat->diffuseColor.setValue(
fr, fg, fb);
158 else if (
type ==
"specular")
159 mat->specularColor.setValue(
fr, fg, fb);
160 else if (
type ==
"emissive")
161 mat->emissiveColor.setValue(
fr, fg, fb);
163 std::cout <<
"ERROR! Color type not supported ==> " <<
type << std::endl;
◆ m_d
The documentation for this class was generated from the following files: