osgEarth 2.1.1
Public Types | Public Member Functions | Protected Attributes

osgEarth::Symbology::Stroke Class Reference

Collaboration diagram for osgEarth::Symbology::Stroke:

List of all members.

Public Types

enum  LineCapStyle { LINECAP_DEFAULT, LINECAP_BUTT, LINECAP_SQUARE, LINECAP_ROUND }
enum  LineJoinStyle { LINEJOIN_DEFAULT }

Public Member Functions

 Stroke ()
 Stroke (float r, float g, float b, float a)
 Stroke (const Config &conf)
osg::Vec4f & color ()
const osg::Vec4f & color () const
optional< LineCapStyle > & lineCap ()
const optional< LineCapStyle > & lineCap () const
optional< LineJoinStyle > & lineJoin ()
const optional< LineJoinStyle > & lineJoin () const
optional< float > & width ()
const optional< float > & width () const
optional< unsigned short > & stipple ()
const optional< unsigned short > & stipple () const
virtual Config getConfig () const
virtual void mergeConfig (const Config &conf)

Protected Attributes

osg::Vec4f _color
optional< LineCapStyle_lineCap
optional< LineJoinStyle_lineJoin
optional< float > _width
optional< unsigned short > _stipple

Detailed Description

Simple drawing parameters for a line.

Definition at line 52 of file Symbol.


Member Enumeration Documentation

Enumerator:
LINECAP_DEFAULT 
LINECAP_BUTT 
LINECAP_SQUARE 
LINECAP_ROUND 

Definition at line 55 of file Symbol.

Enumerator:
LINEJOIN_DEFAULT 

Definition at line 62 of file Symbol.


Constructor & Destructor Documentation

Stroke::Stroke ( )

Definition at line 23 of file GeometrySymbol.cpp.

               :
_color( 1, 1, 1, 1 ),
_lineCap( LINECAP_DEFAULT ),
_lineJoin( LINEJOIN_DEFAULT ),
_width( 1.0f )
{
    //nop
}
Stroke::Stroke ( float  r,
float  g,
float  b,
float  a 
)

Definition at line 32 of file GeometrySymbol.cpp.

                                                   :
_color( r, g, b, a ),
_lineCap( LINECAP_DEFAULT ),
_lineJoin( LINEJOIN_DEFAULT ),
_width( 1.0f )
{
    //nop
}
osgEarth::Symbology::Stroke::Stroke ( const Config conf) [inline]

Definition at line 69 of file Symbol.

{ mergeConfig(conf); }

Member Function Documentation

osg::Vec4f& osgEarth::Symbology::Stroke::color ( ) [inline]

Line color.

Definition at line 72 of file Symbol.

{ return _color; }
const osg::Vec4f& osgEarth::Symbology::Stroke::color ( ) const [inline]

Definition at line 73 of file Symbol.

{ return _color; }
Config Stroke::getConfig ( ) const [virtual]

Definition at line 52 of file Symbol.cpp.

                        {
    Config conf("stroke");
    conf.add( "color", vec4fToHtmlColor(_color) );
    conf.addIfSet("linecap", "butt", _lineCap, LINECAP_BUTT);
    conf.addIfSet("linecap", "square", _lineCap, LINECAP_SQUARE);
    conf.addIfSet("linecap", "round", _lineCap, LINECAP_ROUND);
    conf.addIfSet("width", _width);
    conf.addIfSet("stipple", _stipple);
    return conf;
}

Here is the call graph for this function:

const optional<LineCapStyle>& osgEarth::Symbology::Stroke::lineCap ( ) const [inline]

Definition at line 77 of file Symbol.

{ return _lineCap; }
optional<LineCapStyle>& osgEarth::Symbology::Stroke::lineCap ( ) [inline]

Capping of line ends.

Definition at line 76 of file Symbol.

{ return _lineCap; }
optional<LineJoinStyle>& osgEarth::Symbology::Stroke::lineJoin ( ) [inline]

How to render line joints in a LineString.

Definition at line 80 of file Symbol.

{ return _lineJoin; }
const optional<LineJoinStyle>& osgEarth::Symbology::Stroke::lineJoin ( ) const [inline]

Definition at line 81 of file Symbol.

{ return _lineJoin; }
void Stroke::mergeConfig ( const Config conf) [virtual]

Definition at line 64 of file Symbol.cpp.

                                        {
    _color = htmlColorToVec4f( conf.value("color") );
    conf.getIfSet("linecap", "butt", _lineCap, LINECAP_BUTT);
    conf.getIfSet("linecap", "square", _lineCap, LINECAP_SQUARE);
    conf.getIfSet("linecap", "round", _lineCap, LINECAP_ROUND);
    conf.getIfSet("width", _width);
    conf.getIfSet("stipple", _stipple);
}

Here is the call graph for this function:

const optional<unsigned short>& osgEarth::Symbology::Stroke::stipple ( ) const [inline]

Definition at line 89 of file Symbol.

{ return _stipple; }
optional<unsigned short>& osgEarth::Symbology::Stroke::stipple ( ) [inline]

Stippling pattern.

Definition at line 88 of file Symbol.

{ return _stipple;}
const optional<float>& osgEarth::Symbology::Stroke::width ( ) const [inline]

Definition at line 85 of file Symbol.

{ return _width; }
optional<float>& osgEarth::Symbology::Stroke::width ( ) [inline]

Line rendering width.

Definition at line 84 of file Symbol.

{ return _width; }        

Member Data Documentation

osg::Vec4f osgEarth::Symbology::Stroke::_color [protected]

Definition at line 96 of file Symbol.

Definition at line 97 of file Symbol.

Definition at line 98 of file Symbol.

optional<unsigned short> osgEarth::Symbology::Stroke::_stipple [protected]

Definition at line 100 of file Symbol.

Definition at line 99 of file Symbol.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines