Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Friends | List of all members
hdi::core::Grid Class Reference

Allows manipulation of Illustrator's built-in grids. More...

#include <hdicoreGrid.h>

Classes

class  Spacing
 Describes the spacing and density of gridlines. More...
 

Public Types

enum  Style { UnknownStyle = 0 , GraphStyle = 10 , DottedStyle = 20 }
 Indicates how the grid is drawn.
 
typedef std::unique_ptr< SpacingSpacingUP
 
typedef std::shared_ptr< SpacingSpacingSP
 
typedef std::weak_ptr< SpacingSpacingWP
 

Public Member Functions

 ~Grid ()
 Destructs a Grid object.
 
void show ()
 Shows the grid.
 
void hide ()
 Hides the grid.
 
bool visible () const
 Gets whether the grid is visible or not.
 
void setVisible (const bool visible_)
 Sets whether the grid is visible.
 
bool snaps () const
 Gets whether the gridlines can be snapped to.
 
void setSnaps (const bool snaps_)
 Sets whether the gridlines can be snapped to.
 
bool behindArt () const
 Gets whether the grid draws behind art.
 
void setBehindArt (const bool behind_)
 Sets whether the grid draws behind art.
 
Style style () const
 Gets the gridline style, either kAIGridStyleGraph and kAIGridStyleDotted.
 
void setStyle (const Style style_)
 Sets the gridline style, either kAIGridStyleGraph and kAIGridStyleDotted.
 
Spacing spacing () const
 Gets the spacing of the gridlines.
 
void setSpacing (const Spacing &spacing_)
 Sets the spacing of the gridlines from an AIGridSpacing struct.
 
void setSpacing (const double spacing_, const int32_t ticks_)
 Sets the spacing of the gridlines from a spacing distance and the number of ticks between.
 
Color darkColor () const
 Gets the current "dark" color (for major gridlines)
 
void setDarkColor (const Color &color_)
 Sets the current "dark" color (for major gridlines)
 
Color lightColor () const
 Gets the current "light" color (for minor gridlines, also called "ticks")
 
void setLightColor (const Color &color_)
 Sets the current "light" color (for minor gridlines, also called "ticks")
 

Friends

class CurrentDocument
 

Detailed Description

Allows manipulation of Illustrator's built-in grids.

Constructor & Destructor Documentation

◆ ~Grid()

hdi::core::Grid::~Grid ( )

Destructs a Grid object.

Author
GW
Date
08/2013

Member Function Documentation

◆ behindArt()

bool hdi::core::Grid::behindArt ( ) const

Gets whether the grid draws behind art.

Author
GW
Date
08/2013
Returns
true if the grid is behind art, false otherwise

◆ darkColor()

Color hdi::core::Grid::darkColor ( ) const

Gets the current "dark" color (for major gridlines)

Author
GW
Date
08/2013
Returns
Current color for the major gridlines

◆ hide()

void hdi::core::Grid::hide ( )

Hides the grid.

Author
GW
Date
08/2013

◆ lightColor()

Color hdi::core::Grid::lightColor ( ) const

Gets the current "light" color (for minor gridlines, also called "ticks")

Author
GW
Date
08/2013
Returns
Current color for the minor gridlines

◆ setBehindArt()

void hdi::core::Grid::setBehindArt ( const bool  behind_)

Sets whether the grid draws behind art.

Author
GW
Date
08/2013
Parameters
behind_true for gridline drawing at the "backmost" of the document, false for "frontmost"

◆ setDarkColor()

void hdi::core::Grid::setDarkColor ( const Color color_)

Sets the current "dark" color (for major gridlines)

Author
GW
Date
08/2013
Parameters
color_New color for the major gridlines

◆ setLightColor()

void hdi::core::Grid::setLightColor ( const Color color_)

Sets the current "light" color (for minor gridlines, also called "ticks")

Author
GW
Date
08/2013
Parameters
color_New color for the minor gridlines

◆ setSnaps()

void hdi::core::Grid::setSnaps ( const bool  snaps_)

Sets whether the gridlines can be snapped to.

Author
GW
Date
08/2013
Parameters
snaps_true for snapping, false otherwise

◆ setSpacing() [1/2]

void hdi::core::Grid::setSpacing ( const double  spacing_,
const int32_t  ticks_ 
)

Sets the spacing of the gridlines from a spacing distance and the number of ticks between.

Author
GW
Date
08/2013
Parameters
spacing_New (major) gridline spacing
ticks_Number of ticks (minor lines) between the gridlines

◆ setSpacing() [2/2]

void hdi::core::Grid::setSpacing ( const Spacing spacing_)

Sets the spacing of the gridlines from an AIGridSpacing struct.

Author
GW
Date
08/2013
Parameters
spacing_New (major) gridline spacing and number of ticks (minor lines) between them

◆ setStyle()

void hdi::core::Grid::setStyle ( const Style  style_)

Sets the gridline style, either kAIGridStyleGraph and kAIGridStyleDotted.

Author
GW
Date
08/2013
Parameters
style_New gridline styling

◆ setVisible()

void hdi::core::Grid::setVisible ( const bool  visible_)

Sets whether the grid is visible.

Author
GW
Date
08/2013
Parameters
visible_true for visible, false otherwise
Note
This method simply calls show() or hide() as appropriate

◆ show()

void hdi::core::Grid::show ( )

Shows the grid.

Author
GW
Date
08/2013

◆ snaps()

bool hdi::core::Grid::snaps ( ) const

Gets whether the gridlines can be snapped to.

Author
GW
Date
08/2013
Returns
true to snap the cursor to gridlines, false otherwise

◆ spacing()

Spacing hdi::core::Grid::spacing ( ) const

Gets the spacing of the gridlines.

Author
GW
Date
08/2013
Returns
Current gridline spacing settings

◆ style()

Style hdi::core::Grid::style ( ) const

Gets the gridline style, either kAIGridStyleGraph and kAIGridStyleDotted.

Author
GW
Date
08/2013
Returns
The current gridline styling

◆ visible()

bool hdi::core::Grid::visible ( ) const

Gets whether the grid is visible or not.

Author
GW
Date
08/2013
Returns
true if the grid is visible, false otherwise