33 #ifndef MWAW_GRAPHIC_STYLE
34 # define MWAW_GRAPHIC_STYLE
39 # include "librevenge/librevenge.h"
68 Arrow(
float w,
MWAWBox2i const &box, std::string
const &path,
bool centered=
false)
84 o <<
"w=" << arrow.
m_width <<
",";
85 o <<
"viewbox=" << arrow.
m_viewBox <<
",";
86 o <<
"path=" << arrow.
m_path <<
",";
99 return !(*
this==arrow);
110 return *
this<arrow || *
this==arrow;
115 return !(*
this<=arrow);
120 return !(*
this<arrow);
128 void addTo(librevenge::RVNGPropertyList &propList, std::string
const &type)
const;
163 o <<
"offset=" << st.
m_offset <<
",";
164 o <<
"color=" << st.
m_color <<
",";
166 o <<
"opacity=" << st.
m_opacity*100.f <<
"%,";
224 if (diff)
return diff;
227 for (
size_t h=0; h <
m_data.size(); ++h) {
231 for (
int i=0; i<2; ++i) {
238 if (diff)
return diff;
244 o <<
"dim=" << pat.
m_dim <<
",";
253 for (
auto data : pat.
m_data)
254 o << std::hex << static_cast<int>(data) << std::dec <<
",";
301 for (
auto &fl :
m_flip) fl=
false;
392 std::vector<MWAWBorder>
const &
borders()
const
406 void addTo(librevenge::RVNGPropertyList &pList,
bool only1d=
false)
const;
408 void addFrameTo(librevenge::RVNGPropertyList &pList)
const;
MWAWBox2i m_viewBox
the arrow viewbox
Definition: MWAWGraphicStyle.hxx:131
bool operator>(Arrow const &arrow) const
operator>
Definition: MWAWGraphicStyle.hxx:113
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: MWAWGraphicStyle.hxx:477
virtual ~Pattern()
virtual destructor
Definition: MWAWGraphicStyle.cxx:82
bool isEmpty() const
return true if the picture contains no data
Definition: libmwaw_internal.hxx:485
friend std::ostream & operator<<(std::ostream &o, GradientStop const &st)
a print operator
Definition: MWAWGraphicStyle.hxx:161
bool hasSurfaceColor() const
returns true if the surface is defined
Definition: MWAWGraphicStyle.hxx:328
MWAWVec2i m_dim
the dimension width x height
Definition: MWAWGraphicStyle.hxx:260
bool empty() const
return true if we does not have a pattern
Definition: MWAWGraphicStyle.hxx:206
MWAWColor m_surfaceColor
the surface color
Definition: MWAWGraphicStyle.hxx:425
std::string m_frameNextName
the frame next name (if there is a link)
Definition: MWAWGraphicStyle.hxx:467
MWAWColor m_shadowColor
the shadow color
Definition: MWAWGraphicStyle.hxx:430
Definition: MWAWGraphicStyle.hxx:53
float m_opacity
the opacity
Definition: MWAWGraphicStyle.hxx:174
float m_backgroundOpacity
true if the background has some color
Definition: MWAWGraphicStyle.hxx:459
std::string m_frameName
the frame name
Definition: MWAWGraphicStyle.hxx:465
int cmp(MWAWVec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:775
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:511
float m_shadowOpacity
true if the shadow has some color
Definition: MWAWGraphicStyle.hxx:432
Pattern()
constructor
Definition: MWAWGraphicStyle.hxx:182
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:250
MWAWGraphicStyle()
constructor
Definition: MWAWGraphicStyle.hxx:273
Arrow()
constructor ( no arrow)
Definition: MWAWGraphicStyle.hxx:60
Definition: MWAWGraphicStyle.hxx:55
Pattern(MWAWVec2i dim, MWAWEmbeddedObject const &picture, MWAWColor const &avColor)
constructor from a binary data
Definition: MWAWGraphicStyle.hxx:192
Pattern & operator=(Pattern const &)=default
MWAWVec2f m_gradientPercentCenter
the gradient center
Definition: MWAWGraphicStyle.hxx:448
MWAWEmbeddedObject m_picture
a picture
Definition: MWAWGraphicStyle.hxx:268
static Arrow plain()
returns a basic plain arrow
Definition: MWAWGraphicStyle.hxx:76
void setPattern(Pattern const &pat, float opacity=1)
set the pattern
Definition: MWAWGraphicStyle.hxx:333
MWAWColor m_colors[2]
the two indexed colors
Definition: MWAWGraphicStyle.hxx:263
LineCap
an enum used to define the basic line cap
Definition: MWAWGraphicStyle.hxx:51
LineJoin m_lineJoin
the line join
Definition: MWAWGraphicStyle.hxx:419
Arrow m_arrows[2]
the two arrows corresponding to start and end extremity
Definition: MWAWGraphicStyle.hxx:470
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:423
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:245
float m_gradientRadius
the gradient radius
Definition: MWAWGraphicStyle.hxx:450
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
Definition: MWAWGraphicStyle.hxx:51
GradientType
an enum used to define the gradient type
Definition: MWAWGraphicStyle.hxx:55
bool m_isCentered
flag to know if the arrow is centered
Definition: MWAWGraphicStyle.hxx:137
bool operator<(Arrow const &arrow) const
operator<
Definition: MWAWGraphicStyle.hxx:102
Definition: MWAWGraphicStyle.hxx:55
bool getUniqueColor(MWAWColor &col) const
check if the pattern has only one color; if so returns true...
Definition: MWAWGraphicStyle.cxx:86
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:836
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1189
void addTo(librevenge::RVNGPropertyList &pList, bool only1d=false) const
add all the parameters to the propList excepted the frame parameter: the background and the borders ...
Definition: MWAWGraphicStyle.cxx:191
bool hasSameBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:381
MWAWGraphicStyle & operator=(MWAWGraphicStyle const &)=default
void addFrameTo(librevenge::RVNGPropertyList &pList) const
add all the frame parameters to propList: the background and the borders
Definition: MWAWGraphicStyle.cxx:370
friend std::ostream & operator<<(std::ostream &o, MWAWGraphicStyle const &st)
a print operator
Definition: MWAWGraphicStyle.cxx:502
the class to store a color
Definition: libmwaw_internal.hxx:192
Definition: MWAWGraphicStyle.hxx:51
float m_width
the arrow width in point
Definition: MWAWGraphicStyle.hxx:135
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:344
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:461
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: MWAWGraphicStyle.hxx:413
friend std::ostream & operator<<(std::ostream &o, Arrow const &arrow)
operator<<
Definition: MWAWGraphicStyle.hxx:81
a structure used to define the gradient limit in MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:141
bool isEmpty() const
returns true if there is no arrow
Definition: MWAWGraphicStyle.hxx:123
a border
Definition: libmwaw_internal.hxx:333
Definition: MWAWGraphicStyle.hxx:55
std::string m_extra
extra data
Definition: MWAWGraphicStyle.hxx:482
bool hasPattern() const
returns true if the pattern is defined
Definition: MWAWGraphicStyle.hxx:339
MWAWVec2f m_shadowOffset
the shadow offset
Definition: MWAWGraphicStyle.hxx:434
LineCap m_lineCap
the line cap
Definition: MWAWGraphicStyle.hxx:417
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:427
float m_gradientBorder
the gradient border opacity
Definition: MWAWGraphicStyle.hxx:446
GradientType m_gradientType
the gradient type
Definition: MWAWGraphicStyle.hxx:436
MWAWColor m_backgroundColor
the background color
Definition: MWAWGraphicStyle.hxx:457
Definition: MWAWGraphicStyle.hxx:53
float m_gradientAngle
the gradient angle
Definition: MWAWGraphicStyle.hxx:444
bool hasBackgroundColor() const
returns true if the background is defined
Definition: MWAWGraphicStyle.hxx:360
Pattern m_pattern
the pattern if it exists
Definition: MWAWGraphicStyle.hxx:439
bool hasBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:376
Definition: MWAWGraphicStyle.hxx:53
void setSurfaceColor(MWAWColor const &col, float opacity=1)
set the surface color
Definition: MWAWGraphicStyle.hxx:322
Definition: MWAWGraphicStyle.hxx:51
bool m_fillRuleEvenOdd
true if the fill rule is evenod
Definition: MWAWGraphicStyle.hxx:480
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
bool getAverageColor(MWAWColor &col) const
return the average color
Definition: MWAWGraphicStyle.cxx:101
bool hasSurface() const
returns true if the interior surface is defined
Definition: MWAWGraphicStyle.hxx:349
Definition: MWAWGraphicStyle.hxx:55
a structure used to define an arrow
Definition: MWAWGraphicStyle.hxx:58
int cmp(MWAWEmbeddedObject const &pict) const
a comparison function
Definition: libmwaw_internal.cxx:598
std::vector< MWAWBorder > const & borders() const
return the frame border: libmwaw::Left | ...
Definition: MWAWGraphicStyle.hxx:392
Definition: MWAWGraphicStyle.hxx:55
bool operator==(Arrow const &arrow) const
operator==
Definition: MWAWGraphicStyle.hxx:91
int cmp(GradientStop const &a) const
compare two gradient
Definition: MWAWGraphicStyle.hxx:150
MWAWColor m_color
the color
Definition: MWAWGraphicStyle.hxx:172
Definition: MWAWGraphicStyle.hxx:55
bool operator!=(Arrow const &arrow) const
operator!=
Definition: MWAWGraphicStyle.hxx:97
bool hasShadow() const
returns true if the shadow is defined
Definition: MWAWGraphicStyle.hxx:371
std::vector< MWAWBorder > m_bordersList
the borders MWAWBorder::Pos (for a frame)
Definition: MWAWGraphicStyle.hxx:463
LineJoin
an enum used to define the basic line join
Definition: MWAWGraphicStyle.hxx:53
void setShadowColor(MWAWColor const &col, float opacity=1)
set the shadow color
Definition: MWAWGraphicStyle.hxx:365
virtual ~MWAWGraphicStyle()
virtual destructor
Definition: MWAWGraphicStyle.cxx:168
float m_lineOpacity
the line opacity: 0=transparent
Definition: MWAWGraphicStyle.hxx:421
MWAWColor m_pictureAverageColor
the picture average color
Definition: MWAWGraphicStyle.hxx:270
bool operator<=(Arrow const &arrow) const
operator<=
Definition: MWAWGraphicStyle.hxx:108
void setBackgroundColor(MWAWColor const &col, float opacity=1)
set the background color
Definition: MWAWGraphicStyle.hxx:354
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:415
friend std::ostream & operator<<(std::ostream &o, Pattern const &pat)
a print operator
Definition: MWAWGraphicStyle.hxx:242
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:289
Arrow(float w, MWAWBox2i const &box, std::string const &path, bool centered=false)
constructor
Definition: MWAWGraphicStyle.hxx:68
bool getBinary(MWAWEmbeddedObject &picture) const
tries to convert the picture in a binary data ( ppm)
Definition: MWAWGraphicStyle.cxx:128
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:284
bool hasLine() const
returns true if the border is defined
Definition: MWAWGraphicStyle.hxx:317
std::vector< unsigned char > m_data
the pattern data: a sequence of data: p[0..7,0],p[8..15,0]...p[0..7,1],p[8..15,1], ...
Definition: MWAWGraphicStyle.hxx:265
int cmp(Pattern const &a) const
compare two patterns
Definition: MWAWGraphicStyle.hxx:221
GradientStop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0)
constructor
Definition: MWAWGraphicStyle.hxx:143
int cmp(MWAWGraphicStyle const &a) const
compare two styles
Definition: MWAWGraphicStyle.cxx:418
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:180
void addTo(librevenge::RVNGPropertyList &propList, std::string const &type) const
add a arrow to the propList knowing the type (start, end)
Definition: MWAWGraphicStyle.cxx:56
float m_offset
the offset
Definition: MWAWGraphicStyle.hxx:170
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWGraphicStyle.cxx:172
Definition: MWAWGraphicStyle.hxx:55
std::vector< GradientStop > m_gradientStopList
the list of gradient limits
Definition: MWAWGraphicStyle.hxx:442
bool operator>=(Arrow const &arrow) const
operator>=
Definition: MWAWGraphicStyle.hxx:118
std::string m_path
the arrow path
Definition: MWAWGraphicStyle.hxx:133
static MWAWGraphicStyle emptyStyle()
returns an empty style.
Definition: MWAWGraphicStyle.hxx:308
void resetBorders()
reset the border
Definition: MWAWGraphicStyle.hxx:397