Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
Typedefs | Enumerations | Functions
hdi::core::annotate Namespace Reference

Organizes all annotation drawing functions into one namespace, each of which will only perform their drawing task(s) if called from within an Annotator callback. More...

Typedefs

typedef std::vector< PointPointVector
 
typedef std::vector< SegPointSegPointVector
 

Enumerations

enum  FontType {
  DefaultFont, DialogFont, BoldDialogFont, ItalicDialogFont,
  BoldItalicDialogFont, PanelFont, BoldPanelFont, ItalicPanelFont,
  BoldItalicPanelFont
}
 Describes the type of font to use when annotating text; see also setFontType()
 

Functions

bool line (const Point &start_, const Point &end_)
 Draws a line with the given end points. More...
 
bool dashedLine (const Point &start_, const Point &end_, const double dash_, const double gap_)
 Draws a dashed line with the given end points and dash specs. More...
 
bool rect (const Rect &rect_, const bool fill_=false)
 Draws a rectangle with the given coordinates and fill. More...
 
bool ellipse (const Rect &bounds_, const bool fill_=false)
 Draws an ellipse within the given rectangular bounds. More...
 
bool polygon (const PointVector &points_, const bool fill_=false)
 Draws a polygon constructed of the given points. More...
 
bool bezier (const SegPointVector &segPts_, const bool fill_=false)
 Draws a bezier from the given segment points. More...
 
bool image (const int16_t imgID_, const Point &pt_)
 Draws an image at the given point. More...
 
bool text (const std::string &text_, const Point &pt_, const bool hasCJK_=false)
 Draws text with the current font and left justification. More...
 
bool text (const std::string &text_, const Point &pt_, const ParagraphJustification just_, const bool hasCJK_=false)
 Draws text with the current font and specified justification. More...
 
Color color ()
 Gets the current annotation color. More...
 
void setColor (const Color &color_)
 Sets the current annotation color. More...
 
double lineWidth ()
 Gets the line width used when drawing paths or unfilled objects. More...
 
void setLineWidth (const double width_)
 Sets the line width used when drawing paths or unfilled objects. More...
 
void setFont (const Font &font_)
 Sets the current font for annotation text art. More...
 
void setFontSize (const double size_)
 Sets the current font size for annotation text art. More...
 
std::auto_ptr< Fontfont ()
 Gets the current font for annotation text art. More...
 
double fontSize ()
 Gets the current font size for annotation text art. More...
 
void setFontType (const FontType font_)
 Sets the current font for annotation text art. More...
 
Rect textBounds (const std::string &text_, const bool hasCJK_=false)
 Gets the bounds for the given text at the origin. More...
 
Rect textBounds (const std::string &text_, const Point &pt_, const bool hasCJK_=false)
 Gets the bounds for the given text at an arbitrary point. More...
 
void invalidateAll ()
 Loops through all views of the current document and invalidates their annotations. More...
 

Detailed Description

Organizes all annotation drawing functions into one namespace, each of which will only perform their drawing task(s) if called from within an Annotator callback.

Function Documentation

bool hdi::core::annotate::bezier ( const SegPointVector &  segPts_,
const bool  fill_ = false 
)

Draws a bezier from the given segment points.

Author
GW
Date
07/2014
Parameters
segPts_Segment points of the bezier path
fill_Whether to fill it with the current color
Returns
true if the bezier was drawn, false otherwise
Color hdi::core::annotate::color ( )

Gets the current annotation color.

Author
GW
Date
08/2013
Returns
Color for the current annotation context
bool hdi::core::annotate::dashedLine ( const Point start_,
const Point end_,
const double  dash_,
const double  gap_ 
)

Draws a dashed line with the given end points and dash specs.

Author
GW
Date
03/2017
Parameters
start_Start point for the line
end_End point for the line
dash_Length of the dash components
gap_Length of the gap components (empty space between dashes)
Returns
true if the dashed line was drawn, false otherwise
bool hdi::core::annotate::ellipse ( const Rect bounds_,
const bool  fill_ = false 
)

Draws an ellipse within the given rectangular bounds.

Author
GW
Date
08/2013
Parameters
bounds_Rectangle in which the ellipse fits
fill_Whether to fill it with the current color
Returns
true if the line was drawn, false otherwise
std::auto_ptr<Font> hdi::core::annotate::font ( )

Gets the current font for annotation text art.

Author
GW
Date
08/2013
Returns
Font for the current annotation context
double hdi::core::annotate::fontSize ( )

Gets the current font size for annotation text art.

Author
GW
Date
02/2014
Returns
The font size for the current annotation context
bool hdi::core::annotate::image ( const int16_t  imgID_,
const Point pt_ 
)

Draws an image at the given point.

Author
GW
Date
08/2013
Parameters
imgID_Resource ID of the image to draw
pt_Point at which to draw the image
Returns
true if the image was drawn, false otherwise
Note
At the moment, only PNGI resources are supported
void hdi::core::annotate::invalidateAll ( )

Loops through all views of the current document and invalidates their annotations.

Author
GW
Date
08/2013
bool hdi::core::annotate::line ( const Point start_,
const Point end_ 
)

Draws a line with the given end points.

Author
GW
Date
08/2013
Parameters
start_Start point for the line
end_End point for the line
Returns
true if the line was drawn, false otherwise
double hdi::core::annotate::lineWidth ( )

Gets the line width used when drawing paths or unfilled objects.

Author
GW
Date
07/2014
Returns
The line width in document view points
bool hdi::core::annotate::polygon ( const PointVector &  points_,
const bool  fill_ = false 
)

Draws a polygon constructed of the given points.

Author
GW
Date
08/2013
Parameters
points_Vertex points of the polygon
fill_Whether to fill it with the current color
Returns
true if the polygon was drawn, false otherwise
bool hdi::core::annotate::rect ( const Rect rect_,
const bool  fill_ = false 
)

Draws a rectangle with the given coordinates and fill.

Author
GW
Date
08/2013
Parameters
rect_Rectangle to draw
fill_Whether to fill it with the current color
Returns
true if the rectangle was drawn, false otherwise
void hdi::core::annotate::setColor ( const Color color_)

Sets the current annotation color.

Author
GW
Date
08/2013
Parameters
color_New color for annotation art
void hdi::core::annotate::setFont ( const Font font_)

Sets the current font for annotation text art.

Author
GW
Date
08/2013
Parameters
font_New font for annotating
void hdi::core::annotate::setFontSize ( const double  size_)

Sets the current font size for annotation text art.

Author
GW
Date
02/2014
Parameters
size_New font size for the current annotation context
void hdi::core::annotate::setFontType ( const FontType  font_)

Sets the current font for annotation text art.

Author
GW
Date
08/2013
Parameters
font_New font for annotating
void hdi::core::annotate::setLineWidth ( const double  width_)

Sets the line width used when drawing paths or unfilled objects.

Author
GW
Date
07/2014
Parameters
width_The line width in document view points
bool hdi::core::annotate::text ( const std::string &  text_,
const Point pt_,
const bool  hasCJK_ = false 
)

Draws text with the current font and left justification.

Author
GW
Date
08/2013
Parameters
text_UTF-8 text to draw
pt_Point at which to draw the text
hasCJK_Whether the text has any Chinese, Japanese, or Korean characters (which will affect the bounds calculation algorithm)
Returns
true if the text was drawn, false otherwise
bool hdi::core::annotate::text ( const std::string &  text_,
const Point pt_,
const ParagraphJustification  just_,
const bool  hasCJK_ = false 
)

Draws text with the current font and specified justification.

Author
GW
Date
08/2013
Parameters
text_UTF-8 text to draw
pt_Point at which to draw the text
just_Text justification
hasCJK_Whether the text has any Chinese, Japanese, or Korean characters (which will affect the bounds calculation algorithm)
Returns
true if the text was drawn, false otherwise
Note
The justification can only be LeftJustify, CenterJustify, or RightJustify
Rect hdi::core::annotate::textBounds ( const std::string &  text_,
const bool  hasCJK_ = false 
)

Gets the bounds for the given text at the origin.

Author
GW
Date
08/2013
Parameters
text_UTF-8 text for which bounds are needed
hasCJK_Whether the text has any Chinese, Japanese, or Korean characters (which will affect the bounds calculation algorithm)
Rect hdi::core::annotate::textBounds ( const std::string &  text_,
const Point pt_,
const bool  hasCJK_ = false 
)

Gets the bounds for the given text at an arbitrary point.

Author
GW
Date
08/2013
Parameters
text_UTF-8 text for which bounds are needed
pt_Top-left point for the bounds rect
hasCJK_Whether the text has any Chinese, Japanese, or Korean characters (which will affect the bounds calculation algorithm)