ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | List of all members
SoTransparency Class Reference

#include <SoTransparency.h>

Inheritance diagram for SoTransparency:
Collaboration diagram for SoTransparency:

Public Member Functions

 SoTransparency ()
 

Static Public Member Functions

static void initClass ()
 

Public Attributes

SoSFFloat transparency
 
SoSFBool relative
 

Protected Member Functions

virtual void GLRender (SoGLRenderAction *action)
 
virtual void callback (SoCallbackAction *action)
 
virtual void doAction (SoAction *action)
 

Private Member Functions

 SO_NODE_HEADER (SoTransparency)
 
virtual ~SoTransparency ()
 

Detailed Description

Definition at line 20 of file SoTransparency.h.

Constructor & Destructor Documentation

◆ SoTransparency()

SoTransparency::SoTransparency ( )

Definition at line 38 of file SoTransparency.cxx.

39 {
40  SO_NODE_CONSTRUCTOR(SoTransparency);
41 
42  SO_NODE_ADD_FIELD(transparency, (0.5));
43  SO_NODE_ADD_FIELD(relative, (true));
44  setNodeType(EXTENSION);
45 
46 }

◆ ~SoTransparency()

SoTransparency::~SoTransparency ( )
privatevirtual

Definition at line 49 of file SoTransparency.cxx.

50 {
51 }

Member Function Documentation

◆ callback()

void SoTransparency::callback ( SoCallbackAction *  action)
protectedvirtual

Definition at line 64 of file SoTransparency.cxx.

65 {
67 }

◆ doAction()

void SoTransparency::doAction ( SoAction *  action)
protectedvirtual

Definition at line 70 of file SoTransparency.cxx.

71 {
72  // Make sure the "transparency" field is not ignored. If it is,
73  // then we don't need to change anything in the state.
74  if (transparency.isIgnored())
75  return;
76 
77  const float isRelative = relative.getValue();
78  const float transpVal = transparency.getValue();
79  if ( isRelative && transpVal<=0.0f )
80  return;//No effect
81 
82  const SoTransparencyElement * STE = SoTransparencyElement::getInstance( action->getState() );
83  const int n = STE->getNum();
84  if (n<=0)
85  return;//Nothing to modify
86 
87  float * finalTransparency = new float[n];//NB: Who takes care of deleting finalTransparency??
88  for (int i = 0; i < n; i++)
89  finalTransparency[i] = std::min<float>( 1.0f, std::max<float>( 0.0f, ( isRelative ? ( 1.0 - (1.0 - transpVal) * (1.0 - STE->get(0)) ) : transpVal ) ) );
90 
91  SoTransparencyElement::set(action->getState(), this, n, finalTransparency);
92 
93 }

◆ GLRender()

void SoTransparency::GLRender ( SoGLRenderAction *  action)
protectedvirtual

Definition at line 55 of file SoTransparency.cxx.

56 {
58  SoMaterialBundle mb(action);
59  mb.forceSend(0);
60 }

◆ initClass()

void SoTransparency::initClass ( )
static

Definition at line 29 of file SoTransparency.cxx.

30 {
31  [[maybe_unused]] static const bool didInit = [&]() {
32  SO_NODE_INIT_CLASS(SoTransparency, SoNode, "Node");
33  return true;
34  }();
35 }

◆ SO_NODE_HEADER()

SoTransparency::SO_NODE_HEADER ( SoTransparency  )
private

Member Data Documentation

◆ relative

SoSFBool SoTransparency::relative

Definition at line 28 of file SoTransparency.h.

◆ transparency

SoSFFloat SoTransparency::transparency

Definition at line 27 of file SoTransparency.h.


The documentation for this class was generated from the following files:
SoTransparency::doAction
virtual void doAction(SoAction *action)
Definition: SoTransparency.cxx:70
SoTransparency
Definition: SoTransparency.h:20
SoTransparency::relative
SoSFBool relative
Definition: SoTransparency.h:28
SoTransparency::transparency
SoSFFloat transparency
Definition: SoTransparency.h:27
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
hist_file_dump.f
f
Definition: hist_file_dump.py:135
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
TRT_PAI_physicsConstants::mb
const double mb
1mb to cm2
Definition: TRT_PAI_physicsConstants.h:15
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77