33#ifndef MWAW_GRAPHIC_STYLE
34# define MWAW_GRAPHIC_STYLE
39# include "librevenge/librevenge.h"
69 Arrow(
float w,
MWAWBox2i const &box, std::string
const &path,
bool centered=
false)
85 o <<
"w=" << arrow.
m_width <<
",";
86 o <<
"viewbox=" << arrow.
m_viewBox <<
",";
87 o <<
"path=" << arrow.
m_path <<
",";
100 return !(*
this==arrow);
111 return *
this<arrow || *
this==arrow;
116 return !(*
this<=arrow);
121 return !(*
this<arrow);
129 void addTo(librevenge::RVNGPropertyList &propList, std::string
const &type)
const;
166 o <<
"offset=" << st.
m_offset <<
",";
167 o <<
"color=" << st.
m_color <<
",";
169 o <<
"opacity=" << st.
m_opacity*100.f <<
"%,";
199 void addTo(librevenge::RVNGPropertyList &propList)
const;
225#if !defined(__clang__)
234 o <<
"[" << stop <<
"],";
254 if (diff)
return diff;
259 if (diff)
return diff;
296 void addTo(librevenge::RVNGPropertyList &propList)
const;
315 o <<
"###type=" << int(hatch.
m_type) <<
",";
396 if (diff)
return diff;
399 for (
size_t h=0; h <
m_data.size(); ++h) {
403 for (
int i=0; i<2; ++i) {
410 if (diff)
return diff;
416 o <<
"dim=" << pat.
m_dim <<
",";
425 for (
auto data : pat.
m_data)
426 o << std::hex << static_cast<int>(data) << std::dec <<
",";
471 for (
auto &fl :
m_flip) fl=
false;
566 std::vector<MWAWBorder>
const &
borders()
const
580 void addTo(librevenge::RVNGPropertyList &pList,
bool only1d=
false)
const;
582 void addFrameTo(librevenge::RVNGPropertyList &pList)
const;
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:48
bool m_doNotPrint
a bool to know if the shape must not be printed
Definition: MWAWGraphicStyle.hxx:649
bool hasHatch() const
returns true if the hatch is defined
Definition: MWAWGraphicStyle.hxx:518
void setShadowColor(MWAWColor const &col, float opacity=1)
set the shadow color
Definition: MWAWGraphicStyle.hxx:539
std::vector< MWAWBorder > m_bordersList
the borders MWAWBorder::Pos (for a frame)
Definition: MWAWGraphicStyle.hxx:629
MWAWVec2f m_shadowOffset
the shadow offset
Definition: MWAWGraphicStyle.hxx:608
VerticalAlignment m_verticalAlignment
related to text area
Definition: MWAWGraphicStyle.hxx:652
Gradient m_gradient
the gradient
Definition: MWAWGraphicStyle.hxx:614
VerticalAlignment
an enum used to define the vertical alignment
Definition: MWAWGraphicStyle.hxx:56
@ V_AlignJustify
Definition: MWAWGraphicStyle.hxx:56
@ V_AlignTop
Definition: MWAWGraphicStyle.hxx:56
@ V_AlignDefault
Definition: MWAWGraphicStyle.hxx:56
@ V_AlignCenter
Definition: MWAWGraphicStyle.hxx:56
@ V_AlignBottom
Definition: MWAWGraphicStyle.hxx:56
friend std::ostream & operator<<(std::ostream &o, MWAWGraphicStyle const &st)
a print operator
Definition: MWAWGraphicStyle.cxx:572
bool m_fillRuleEvenOdd
true if the fill rule is evenod
Definition: MWAWGraphicStyle.hxx:646
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:627
bool hasBackgroundColor() const
returns true if the background is defined
Definition: MWAWGraphicStyle.hxx:534
bool hasSurfaceColor() const
returns true if the surface is defined
Definition: MWAWGraphicStyle.hxx:497
std::string m_frameNextName
the frame next name (if there is a link)
Definition: MWAWGraphicStyle.hxx:633
void addFrameTo(librevenge::RVNGPropertyList &pList) const
add all the frame parameters to propList: the background and the borders
Definition: MWAWGraphicStyle.cxx:451
int cmp(MWAWGraphicStyle const &a) const
compare two styles
Definition: MWAWGraphicStyle.cxx:499
MWAWColor m_surfaceColor
the surface color
Definition: MWAWGraphicStyle.hxx:599
float m_shadowOpacity
true if the shadow has some color
Definition: MWAWGraphicStyle.hxx:606
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:589
bool hasSurface() const
returns true if the interior surface is defined
Definition: MWAWGraphicStyle.hxx:523
MWAWColor m_backgroundColor
the background color
Definition: MWAWGraphicStyle.hxx:623
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWGraphicStyle.cxx:274
std::string m_frameName
the frame name
Definition: MWAWGraphicStyle.hxx:631
MWAWColor m_shadowColor
the shadow color
Definition: MWAWGraphicStyle.hxx:604
std::string m_extra
extra data
Definition: MWAWGraphicStyle.hxx:655
bool hasShadow() const
returns true if the shadow is defined
Definition: MWAWGraphicStyle.hxx:545
static MWAWGraphicStyle emptyStyle()
returns an empty style.
Definition: MWAWGraphicStyle.hxx:477
MWAWGraphicStyle()
constructor
Definition: MWAWGraphicStyle.hxx:445
float m_lineOpacity
the line opacity: 0=transparent
Definition: MWAWGraphicStyle.hxx:595
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:513
void setBackgroundColor(MWAWColor const &col, float opacity=1)
set the background color
Definition: MWAWGraphicStyle.hxx:528
bool hasLine() const
returns true if the border is defined
Definition: MWAWGraphicStyle.hxx:486
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:601
float m_backgroundOpacity
true if the background has some color
Definition: MWAWGraphicStyle.hxx:625
Hatch m_hatch
the hatch
Definition: MWAWGraphicStyle.hxx:616
MWAWGraphicStyle & operator=(MWAWGraphicStyle &&)=default
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: MWAWGraphicStyle.hxx:643
LineCap
an enum used to define the basic line cap
Definition: MWAWGraphicStyle.hxx:51
@ C_Round
Definition: MWAWGraphicStyle.hxx:51
@ C_Butt
Definition: MWAWGraphicStyle.hxx:51
@ C_Square
Definition: MWAWGraphicStyle.hxx:51
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: MWAWGraphicStyle.hxx:587
Pattern m_pattern
the pattern if it exists
Definition: MWAWGraphicStyle.hxx:611
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:597
bool hasBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:550
void setSurfaceColor(MWAWColor const &col, float opacity=1)
set the surface color
Definition: MWAWGraphicStyle.hxx:491
virtual ~MWAWGraphicStyle()
virtual destructor
Definition: MWAWGraphicStyle.cxx:270
bool hasPattern() const
returns true if the pattern is defined
Definition: MWAWGraphicStyle.hxx:508
std::vector< MWAWBorder > const & borders() const
return the frame border: libmwaw::Left | ...
Definition: MWAWGraphicStyle.hxx:566
void resetBorders()
reset the border
Definition: MWAWGraphicStyle.hxx:571
bool hasSameBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:555
MWAWGraphicStyle(MWAWGraphicStyle const &)=default
Arrow m_arrows[2]
the two arrows corresponding to start and end extremity
Definition: MWAWGraphicStyle.hxx:636
LineJoin
an enum used to define the basic line join
Definition: MWAWGraphicStyle.hxx:53
@ J_Bevel
Definition: MWAWGraphicStyle.hxx:53
@ J_Miter
Definition: MWAWGraphicStyle.hxx:53
@ J_Round
Definition: MWAWGraphicStyle.hxx:53
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:293
MWAWGraphicStyle & operator=(MWAWGraphicStyle const &)=default
LineCap m_lineCap
the line cap
Definition: MWAWGraphicStyle.hxx:591
LineJoin m_lineJoin
the line join
Definition: MWAWGraphicStyle.hxx:593
void setPattern(Pattern const &pat, float opacity=1)
set the pattern
Definition: MWAWGraphicStyle.hxx:502
int cmp(MWAWVec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:777
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:838
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1191
a border
Definition: libmwaw_internal.hxx:333
the class to store a color
Definition: libmwaw_internal.hxx:192
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:245
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:289
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:250
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:284
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
int cmp(MWAWEmbeddedObject const &pict) const
a comparison function
Definition: libmwaw_internal.cxx:606
bool isEmpty() const
return true if the picture contains no data
Definition: libmwaw_internal.hxx:486
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:512
a structure used to define an arrow
Definition: MWAWGraphicStyle.hxx:59
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
std::string m_path
the arrow path
Definition: MWAWGraphicStyle.hxx:134
bool m_isCentered
flag to know if the arrow is centered
Definition: MWAWGraphicStyle.hxx:138
static Arrow plain()
returns a basic plain arrow
Definition: MWAWGraphicStyle.hxx:77
bool operator>(Arrow const &arrow) const
operator>
Definition: MWAWGraphicStyle.hxx:114
float m_width
the arrow width in point
Definition: MWAWGraphicStyle.hxx:136
bool operator!=(Arrow const &arrow) const
operator!=
Definition: MWAWGraphicStyle.hxx:98
bool operator>=(Arrow const &arrow) const
operator>=
Definition: MWAWGraphicStyle.hxx:119
bool operator<=(Arrow const &arrow) const
operator<=
Definition: MWAWGraphicStyle.hxx:109
friend std::ostream & operator<<(std::ostream &o, Arrow const &arrow)
operator<<
Definition: MWAWGraphicStyle.hxx:82
bool isEmpty() const
returns true if there is no arrow
Definition: MWAWGraphicStyle.hxx:124
bool operator<(Arrow const &arrow) const
operator<
Definition: MWAWGraphicStyle.hxx:103
bool operator==(Arrow const &arrow) const
operator==
Definition: MWAWGraphicStyle.hxx:92
Arrow(float w, MWAWBox2i const &box, std::string const &path, bool centered=false)
constructor
Definition: MWAWGraphicStyle.hxx:69
MWAWBox2i m_viewBox
the arrow viewbox
Definition: MWAWGraphicStyle.hxx:132
Arrow()
constructor ( no arrow)
Definition: MWAWGraphicStyle.hxx:61
a structure used to define the gradient limit in MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:144
float m_opacity
the opacity
Definition: MWAWGraphicStyle.hxx:177
friend std::ostream & operator<<(std::ostream &o, Stop const &st)
a print operator
Definition: MWAWGraphicStyle.hxx:164
float m_offset
the offset
Definition: MWAWGraphicStyle.hxx:173
MWAWColor m_color
the color
Definition: MWAWGraphicStyle.hxx:175
int cmp(Stop const &a) const
compare two gradient
Definition: MWAWGraphicStyle.hxx:153
Stop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0)
constructor
Definition: MWAWGraphicStyle.hxx:146
a basic gradient used in a MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:142
float m_radius
the gradient radius
Definition: MWAWGraphicStyle.hxx:275
std::vector< Stop > m_stopList
the list of gradient limits
Definition: MWAWGraphicStyle.hxx:267
Gradient()
constructor
Definition: MWAWGraphicStyle.hxx:182
Type
an enum used to define the gradient type
Definition: MWAWGraphicStyle.hxx:180
@ G_Axial
Definition: MWAWGraphicStyle.hxx:180
@ G_Linear
Definition: MWAWGraphicStyle.hxx:180
@ G_Square
Definition: MWAWGraphicStyle.hxx:180
@ G_Rectangular
Definition: MWAWGraphicStyle.hxx:180
@ G_Radial
Definition: MWAWGraphicStyle.hxx:180
@ G_None
Definition: MWAWGraphicStyle.hxx:180
@ G_Ellipsoid
Definition: MWAWGraphicStyle.hxx:180
void addTo(librevenge::RVNGPropertyList &propList) const
add a gradient to the propList
Definition: MWAWGraphicStyle.cxx:191
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:194
float m_angle
the gradient angle
Definition: MWAWGraphicStyle.hxx:269
float m_border
the gradient border opacity
Definition: MWAWGraphicStyle.hxx:271
int cmp(Gradient const &a) const
compare two gradient
Definition: MWAWGraphicStyle.hxx:244
friend std::ostream & operator<<(std::ostream &o, Gradient const &grad)
a print operator
Definition: MWAWGraphicStyle.hxx:203
bool getAverageColor(MWAWColor &color) const
returns the average gradient color if the gradient is defined.
Definition: MWAWGraphicStyle.cxx:168
MWAWVec2f m_percentCenter
the gradient center
Definition: MWAWGraphicStyle.hxx:273
Type m_type
the gradient type
Definition: MWAWGraphicStyle.hxx:265
a basic hatch used in MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:279
float m_distance
the hatch distance in inches
Definition: MWAWGraphicStyle.hxx:343
friend std::ostream & operator<<(std::ostream &o, Hatch const &hatch)
a print operator
Definition: MWAWGraphicStyle.hxx:298
Type
the potential type
Definition: MWAWGraphicStyle.hxx:281
@ H_Triple
Definition: MWAWGraphicStyle.hxx:281
@ H_Single
Definition: MWAWGraphicStyle.hxx:281
@ H_None
Definition: MWAWGraphicStyle.hxx:281
@ H_Double
Definition: MWAWGraphicStyle.hxx:281
bool hasHatch() const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:291
Hatch()
constructor
Definition: MWAWGraphicStyle.hxx:283
MWAWColor m_color
the hatch color
Definition: MWAWGraphicStyle.hxx:341
int cmp(Hatch const &a) const
compare two hatchs
Definition: MWAWGraphicStyle.hxx:326
void addTo(librevenge::RVNGPropertyList &propList) const
add a hatch to the propList
Definition: MWAWGraphicStyle.cxx:251
float m_rotation
the rotation (in degrees)
Definition: MWAWGraphicStyle.hxx:345
Type m_type
the hatch type
Definition: MWAWGraphicStyle.hxx:339
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:351
MWAWColor m_colors[2]
the two indexed colors
Definition: MWAWGraphicStyle.hxx:435
Pattern()
constructor
Definition: MWAWGraphicStyle.hxx:353
MWAWVec2i m_dim
the dimension width x height
Definition: MWAWGraphicStyle.hxx:432
friend std::ostream & operator<<(std::ostream &o, Pattern const &pat)
a print operator
Definition: MWAWGraphicStyle.hxx:414
bool getAverageColor(MWAWColor &col) const
return the average color
Definition: MWAWGraphicStyle.cxx:101
Pattern(MWAWVec2i dim, MWAWEmbeddedObject const &picture, MWAWColor const &avColor)
constructor from a binary data
Definition: MWAWGraphicStyle.hxx:363
Pattern & operator=(Pattern const &)=default
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:437
Pattern & operator=(Pattern &&)=default
MWAWColor m_pictureAverageColor
the picture average color
Definition: MWAWGraphicStyle.hxx:442
Pattern(Pattern const &)=default
bool getUniqueColor(MWAWColor &col) const
check if the pattern has only one color; if so returns true...
Definition: MWAWGraphicStyle.cxx:86
int cmp(Pattern const &a) const
compare two patterns
Definition: MWAWGraphicStyle.hxx:393
bool getBinary(MWAWEmbeddedObject &picture) const
tries to convert the picture in a binary data ( ppm)
Definition: MWAWGraphicStyle.cxx:128
virtual ~Pattern()
virtual destructor
Definition: MWAWGraphicStyle.cxx:82
MWAWEmbeddedObject m_picture
a picture
Definition: MWAWGraphicStyle.hxx:440
bool empty() const
return true if we does not have a pattern
Definition: MWAWGraphicStyle.hxx:378