36#include <Inventor/nodes/SoMaterial.h>
37#include <Inventor/nodes/SoDrawStyle.h>
38#include <Inventor/nodes/SoLightModel.h>
39#include <Inventor/nodes/SoResetTransform.h>
51 fMaterials =
new SoGroup;
53 fLineStyles =
new SoGroup;
54 addChild(fLineStyles);
55 fLightModels =
new SoGroup;
56 addChild(fLightModels);
57 fResetTransform =
new SoResetTransform;
58 addChild(fResetTransform);
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) ) {
83 SoMaterial* material =
new SoMaterial;
84 material->diffuseColor.setValue(aRGB);
85 material->transparency.setValue(aTransparency);
86 fMaterials->addChild(material);
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) ) {
108 SoMaterial* material =
new SoMaterial;
109 material->diffuseColor.setValue(aRGB);
110 material->transparency.setValue(aTransparency);
111 fMaterials->addChild(material);
116SoDrawStyle* SoStyleCache::getLineStyle(
123 unsigned short pattern = 0xFFFF;
131 case SbLineDashDotted:
134 default: //SbLineSolid:
138 int number = fLineStyles->getNumChildren();
139 for(int index=0;index<number;index++) {
140 SoDrawStyle* drawStyle = (SoDrawStyle*)fLineStyles->getChild(index);
141 if( (drawStyle->style.getValue()==SoDrawStyle::LINES) &&
142 (drawStyle->lineWidth.getValue()==aWidth) &&
143 (drawStyle->linePattern.getValue()==pattern) ) {
147 SoDrawStyle* drawStyle = new SoDrawStyle;
148 drawStyle->style.setValue(SoDrawStyle::LINES);
149 drawStyle->lineWidth.setValue(aWidth);
150 drawStyle->linePattern.setValue(pattern);
151 fLineStyles->addChild(drawStyle);
157 unsigned short aPattern
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) ) {
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);
185 SoLightModel* lightModel =
new SoLightModel;
186 lightModel->model.setValue(SoLightModel::PHONG);
187 fLightModels->addChild(lightModel);
196 SoLightModel* lightModel =
new SoLightModel;
197 lightModel->model.setValue(SoLightModel::BASE_COLOR);
198 fLightModels->addChild(lightModel);
207 return fResetTransform;
SoLightModel * getLightModelPhong()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
~SoStyleCache()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
SoLightModel * getLightModelBaseColor()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
SoDrawStyle * getLineStyle(unsigned short=0xFFFF, float=0)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
SoResetTransform * getResetTransform()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
SoMaterial * getMaterial(const SbColor &, float=0)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//