/usr/include/OpenLayer/Point.hpp is in libopenlayer-dev 2.1-2.1.
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 76 77 78 79 80 81 82 83 84 85 86 | #ifndef OL_POINT_HPP
#define OL_POINT_HPP
#include "Shape.hpp"
#include "Vec2D.hpp"
#include "Declspec.hpp"
namespace ol {
class OL_LIB_DECLSPEC Point : public Shape {
public:
Point( Vec2D pos )
: pos( pos ) {}
Point( float x, float y )
: pos( x, y ) {}
// Draws the shape with the specified color //
inline void Draw( const Rgba &color ) {
OL_SHAPE_START_RENDERING()
color.Select();
ExecDraw();
OL_SHAPE_FINISH_RENDERING()
}
// Draws the outline of the shape with the specified color //
inline void DrawOutline( const Rgba &color ) {
Draw( color );
}
static inline void StartFastDrawing() {
glBegin( GL_POINTS );
}
inline void DrawFast( const Rgba &color ) {
color.Select();
glVertex2f( pos.x + 0.5, pos.y + 0.5 );
}
static inline void FinishFastDrawing() {
glEnd();
}
inline void MoveBy( const Vec2D &amount ) {
pos += amount;
}
inline void MoveTo( const Vec2D &position ) {
pos = position;
}
/*
* return this back to normal if problems arise
virtual void TransformBy( const Placement &placement );
virtual std::string ToString() const;
*/
virtual void TransformBy(const Placement &placement);
virtual std::string ToString() const;
Vec2D pos;
protected:
inline void ExecDraw() const {
glBegin( GL_POINTS );
glVertex2f( pos.x + 0.5, pos.y + 0.5 );
glEnd();
}
inline void ExecDrawOutline() const {
ExecDraw();
}
};
}
#endif // OL_POINT_HPP
|