0001032: Preference setting for bounding box colour

This commit is contained in:
Yorik van Havre
2013-06-27 20:42:30 -03:00
parent ea08d136f8
commit b2c635e40c
3 changed files with 36 additions and 2 deletions

View File

@@ -482,13 +482,17 @@ SoPickedPoint* ViewProviderGeometryObject::getPickedPoint(const SbVec2s& pos, co
void ViewProviderGeometryObject::showBoundingBox(bool show)
{
if (!pcBoundSwitch && show) {
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
unsigned long bbcol = hGrp->GetUnsigned("BoundingBoxColor",4294967295UL); // white (255,255,255)
float r,g,b;
r = ((bbcol >> 24) & 0xff) / 255.0; g = ((bbcol >> 16) & 0xff) / 255.0; b = ((bbcol >> 8) & 0xff) / 255.0;
pcBoundSwitch = new SoSwitch();
SoSeparator* pBoundingSep = new SoSeparator();
SoDrawStyle* lineStyle = new SoDrawStyle;
lineStyle->lineWidth = 2.0f;
pBoundingSep->addChild(lineStyle);
SoBaseColor* color = new SoBaseColor();
color->rgb.setValue(1.0f, 1.0f, 1.0f);
color->rgb.setValue(r, g, b);
pBoundingSep->addChild(color);
pBoundingSep->addChild(new SoTransform());