~s-cecilio/lomse/master

« back to all changes in this revision

Viewing changes to include/lomse_path_attributes.h

  • Committer: cecilios
  • Date: 2010-11-14 17:47:31 UTC
  • Revision ID: git-v1:1fa3764c8c4d338b95b1a537b1e78271170c0025
latest new code. demo_1 tested on linux and win32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//---------------------------------------------------------------------------------------
 
2
//  This file is part of the Lomse library.
 
3
//  Copyright (c) 2010 Lomse project
 
4
//
 
5
//  Lomse is free software; you can redistribute it and/or modify it under the
 
6
//  terms of the GNU General Public License as published by the Free Software Foundation,
 
7
//  either version 3 of the License, or (at your option) any later version.
 
8
//
 
9
//  Lomse is distributed in the hope that it will be useful, but WITHOUT ANY
 
10
//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
11
//  PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
12
//
 
13
//  You should have received a copy of the GNU General Public License along
 
14
//  with Lomse; if not, see <http://www.gnu.org/licenses/>.
 
15
//  
 
16
//  For any comment, suggestion or feature request, please contact the manager of
 
17
//  the project at cecilios@users.sourceforge.net
 
18
//
 
19
//---------------------------------------------------------------------------------------
 
20
 
 
21
#ifndef __LOMSE_PATH_ATTRIBUTES_H__        //to avoid nested includes
 
22
#define __LOMSE_PATH_ATTRIBUTES_H__
 
23
 
 
24
#include "lomse_agg_types.h"
 
25
 
 
26
using namespace agg;
 
27
 
 
28
namespace lomse
 
29
{
 
30
 
 
31
// PathAttributes: struct to contain attributes for a path
 
32
//---------------------------------------------------------------------------------------
 
33
struct PathAttributes
 
34
{
 
35
    unsigned     index;
 
36
    rgba8        fill_color;
 
37
    rgba8        stroke_color;
 
38
    bool         fill_flag;
 
39
    bool         stroke_flag;
 
40
    bool         even_odd_flag;
 
41
    line_join_e  line_join;
 
42
    line_cap_e   line_cap;
 
43
    double       miter_limit;
 
44
    double       stroke_width;
 
45
    TransAffine  transform;
 
46
 
 
47
    // Empty constructor
 
48
    PathAttributes()
 
49
        : index(0)
 
50
        , fill_color(rgba(0,0,0))
 
51
        , stroke_color(rgba(0,0,0))
 
52
        , fill_flag(true)
 
53
        , stroke_flag(false)
 
54
        , even_odd_flag(false)
 
55
        , line_join(miter_join)
 
56
        , line_cap(butt_cap)
 
57
        , miter_limit(4.0)
 
58
        , stroke_width(1.0)
 
59
        , transform()
 
60
    {
 
61
    }
 
62
 
 
63
    // Copy constructor
 
64
    PathAttributes(const PathAttributes& attr)
 
65
        : index(attr.index)
 
66
        , fill_color(attr.fill_color)
 
67
        , stroke_color(attr.stroke_color)
 
68
        , fill_flag(attr.fill_flag)
 
69
        , stroke_flag(attr.stroke_flag)
 
70
        , even_odd_flag(attr.even_odd_flag)
 
71
        , line_join(attr.line_join)
 
72
        , line_cap(attr.line_cap)
 
73
        , miter_limit(attr.miter_limit)
 
74
        , stroke_width(attr.stroke_width)
 
75
        , transform(attr.transform)
 
76
    {
 
77
    }
 
78
 
 
79
    // Copy constructor with new index value
 
80
    PathAttributes(const PathAttributes& attr, unsigned idx)
 
81
        : index(idx)
 
82
        , fill_color(attr.fill_color)
 
83
        , stroke_color(attr.stroke_color)
 
84
        , fill_flag(attr.fill_flag)
 
85
        , stroke_flag(attr.stroke_flag)
 
86
        , even_odd_flag(attr.even_odd_flag)
 
87
        , line_join(attr.line_join)
 
88
        , line_cap(attr.line_cap)
 
89
        , miter_limit(attr.miter_limit)
 
90
        , stroke_width(attr.stroke_width)
 
91
        , transform(attr.transform)
 
92
    {
 
93
    }
 
94
};
 
95
 
 
96
 
 
97
typedef pod_bvector<PathAttributes>     AttrStorage;
 
98
 
 
99
 
 
100
 
 
101
}   //namespace lomse
 
102
 
 
103
#endif    // __LOMSE_PATH_ATTRIBUTES_H__
 
104