Geant4-11
Public Member Functions | Protected Member Functions | Private Attributes
SoStyleCache Class Reference

#include <SoStyleCache.h>

Inheritance diagram for SoStyleCache:

Public Member Functions

SoLightModel * getLightModelBaseColor ()
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// More...
 
SoLightModel * getLightModelPhong ()
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// More...
 
SoDrawStyle * getLineStyle (unsigned short=0xFFFF, float=0)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// More...
 
SoMaterial * getMaterial (const SbColor &, float=0)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// More...
 
SoMaterial * getMaterial (float, float, float, float=0)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// More...
 
SoResetTransform * getResetTransform ()
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// More...
 
 SoStyleCache ()
 

Protected Member Functions

 ~SoStyleCache ()
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// More...
 

Private Attributes

SoGroup * fLightModels
 
SoGroup * fLineStyles
 
SoGroup * fMaterials
 
SoResetTransform * fResetTransform
 

Detailed Description

Definition at line 43 of file SoStyleCache.h.

Constructor & Destructor Documentation

◆ SoStyleCache()

SoStyleCache::SoStyleCache ( )

Definition at line 42 of file SoStyleCache.cc.

44:fMaterials(0)
50{
51 fMaterials = new SoGroup;
52 addChild(fMaterials);
53 fLineStyles = new SoGroup;
54 addChild(fLineStyles);
55 fLightModels = new SoGroup;
56 addChild(fLightModels);
57 fResetTransform = new SoResetTransform;
58 addChild(fResetTransform);
59}
SoGroup * fLightModels
Definition: SoStyleCache.h:59
SoGroup * fLineStyles
Definition: SoStyleCache.h:58
SoGroup * fMaterials
Definition: SoStyleCache.h:57
SoResetTransform * fResetTransform
Definition: SoStyleCache.h:60

References fLightModels, fLineStyles, fMaterials, and fResetTransform.

◆ ~SoStyleCache()

SoStyleCache::~SoStyleCache ( )
protected

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 61 of file SoStyleCache.cc.

65{
66}

Member Function Documentation

◆ getLightModelBaseColor()

SoLightModel * SoStyleCache::getLightModelBaseColor ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 191 of file SoStyleCache.cc.

195{
196 SoLightModel* lightModel = new SoLightModel;
197 lightModel->model.setValue(SoLightModel::BASE_COLOR);
198 fLightModels->addChild(lightModel);
199 return lightModel;
200}

References fLightModels.

◆ getLightModelPhong()

SoLightModel * SoStyleCache::getLightModelPhong ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 180 of file SoStyleCache.cc.

184{
185 SoLightModel* lightModel = new SoLightModel;
186 lightModel->model.setValue(SoLightModel::PHONG);
187 fLightModels->addChild(lightModel);
188 return lightModel;
189}

References fLightModels.

◆ getLineStyle()

SoDrawStyle * SoStyleCache::getLineStyle ( unsigned short  aPattern = 0xFFFF,
float  aWidth = 0 
)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 156 of file SoStyleCache.cc.

162{
163 int number = fLineStyles->getNumChildren();
164 for(int index=0;index<number;index++) {
165 SoDrawStyle* drawStyle = (SoDrawStyle*)fLineStyles->getChild(index);
166 if( (drawStyle->style.getValue()==SoDrawStyle::LINES) &&
167 (drawStyle->lineWidth.getValue()==aWidth) &&
168 (drawStyle->linePattern.getValue()==aPattern) ) {
169 return drawStyle;
170 }
171 }
172 SoDrawStyle* drawStyle = new SoDrawStyle;
173 drawStyle->style.setValue(SoDrawStyle::LINES);
174 drawStyle->lineWidth.setValue(aWidth);
175 drawStyle->linePattern.setValue(aPattern);
176 fLineStyles->addChild(drawStyle);
177 return drawStyle;
178}

References fLineStyles.

◆ getMaterial() [1/2]

SoMaterial * SoStyleCache::getMaterial ( const SbColor &  aRGB,
float  aTransparency = 0 
)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 68 of file SoStyleCache.cc.

74{
75 int number = fMaterials->getNumChildren();
76 for(int index=0;index<number;index++) {
77 SoMaterial* material = (SoMaterial*)fMaterials->getChild(index);
78 if( (material->diffuseColor[0]==aRGB) &&
79 (material->transparency[0]==aTransparency) ) {
80 return material;
81 }
82 }
83 SoMaterial* material = new SoMaterial;
84 material->diffuseColor.setValue(aRGB);
85 material->transparency.setValue(aTransparency);
86 fMaterials->addChild(material);
87 return material;
88}
string material
Definition: eplot.py:19

References fMaterials, and eplot::material.

◆ getMaterial() [2/2]

SoMaterial * SoStyleCache::getMaterial ( float  aRed,
float  aGreen,
float  aBlue,
float  aTransparency = 0 
)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 90 of file SoStyleCache.cc.

98{
99 SbColor aRGB(aRed,aGreen,aBlue);
100 int number = fMaterials->getNumChildren();
101 for(int index=0;index<number;index++) {
102 SoMaterial* material = (SoMaterial*)fMaterials->getChild(index);
103 if( (material->diffuseColor[0]==aRGB) &&
104 (material->transparency[0]==aTransparency) ) {
105 return material;
106 }
107 }
108 SoMaterial* material = new SoMaterial;
109 material->diffuseColor.setValue(aRGB);
110 material->transparency.setValue(aTransparency);
111 fMaterials->addChild(material);
112 return material;
113}

References fMaterials, and eplot::material.

◆ getResetTransform()

SoResetTransform * SoStyleCache::getResetTransform ( )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 202 of file SoStyleCache.cc.

206{
207 return fResetTransform;
208}

References fResetTransform.

Field Documentation

◆ fLightModels

SoGroup* SoStyleCache::fLightModels
private

Definition at line 59 of file SoStyleCache.h.

Referenced by getLightModelBaseColor(), getLightModelPhong(), and SoStyleCache().

◆ fLineStyles

SoGroup* SoStyleCache::fLineStyles
private

Definition at line 58 of file SoStyleCache.h.

Referenced by getLineStyle(), and SoStyleCache().

◆ fMaterials

SoGroup* SoStyleCache::fMaterials
private

Definition at line 57 of file SoStyleCache.h.

Referenced by getMaterial(), and SoStyleCache().

◆ fResetTransform

SoResetTransform* SoStyleCache::fResetTransform
private

Definition at line 60 of file SoStyleCache.h.

Referenced by getResetTransform(), and SoStyleCache().


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