This file is indexed.

/usr/share/openscenegraph/examples/osgwidgetshader/osgwidgetshader.cpp is in openscenegraph-examples 3.2.1-7ubuntu4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// -*-c++-*- osgWidget - Code by: Jeremy Moles (cubicool) 2007-2008
// $Id: osgwidgetshader.cpp 28 2008-03-26 15:26:48Z cubicool $

#include <osgDB/FileUtils>
#include <osgWidget/Util>
#include <osgWidget/WindowManager>
#include <osgWidget/Canvas>

const unsigned int MASK_2D = 0xF0000000;

osgWidget::Widget* createWidget(
    const std::string&       name,
    osgWidget::color_type    col,
    osgWidget::Widget::Layer layer
) {
    osgWidget::Widget* widget = new osgWidget::Widget(name, 200.0f, 200.0f);

    widget->setColor(col, col, col, 0.2f);
    widget->setLayer(layer);

    return widget;
}

int main(int argc, char** argv) {
    osgViewer::Viewer viewer;

    osgWidget::WindowManager* wm = new osgWidget::WindowManager(
        &viewer,
        1280.0f,
        1024.0f,
        MASK_2D
    );
    
    osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas");

    canvas->attachMoveCallback();
    canvas->attachScaleCallback();

    canvas->addWidget(
        createWidget("w1", 0.2f, osgWidget::Widget::LAYER_LOW),
        0.0f,
        0.0f
    );
    
    canvas->addWidget(
        createWidget("w2", 0.4f, osgWidget::Widget::LAYER_MIDDLE),
        200.0f,
        0.0f
    );

    canvas->addWidget(
        createWidget("w3", 0.6f, osgWidget::Widget::LAYER_HIGH),
        400.0f,
        0.0f
    );


    wm->addChild(canvas);

    osg::Program* program = new osg::Program();

    program->addShader(osg::Shader::readShaderFile(
        osg::Shader::VERTEX,
        osgDB::findDataFile("osgWidget/osgwidgetshader-vert.glsl")
    ));
    
    program->addShader(osg::Shader::readShaderFile(
        osg::Shader::FRAGMENT,
        osgDB::findDataFile("osgWidget/osgwidgetshader-frag.glsl")
    ));

    canvas->getGeode()->getOrCreateStateSet()->setAttribute(program);

    return osgWidget::createExample(viewer, wm);
}