Hot Door CORE
0.7.1
Adobe® Illustrator® Plugin Library

Allows for path manipulation, metadata access, trimming, extending, etc. More...
#include <hdicorePathArt.h>
Public Types  
enum  WindingOrderType { WindingUnknown = 0, Clockwise = 1, CounterClockwise = 2 } 
Describes which direction the (closed) art is wound.  
enum  SegPointSelectionState { SegPointNotSelected = 0, SegPointAnchorSelected = 1 << 0, SegPointInSelected = 1 << 1, SegPointOutSelected = 1 << 2, SegPointAllSelected = (SegPointAnchorSelected  SegPointInSelected  SegPointOutSelected) } 
Describes how an individual segment point is selected, if at all. More...  
enum  TrimDirectionType { TrimGreaterDirectionOnly = 1 << 0, TrimLesserDirectionOnly = 1 << 1, TrimBothDirections = (TrimGreaterDirectionOnly  TrimLesserDirectionOnly) } 
Describes which direction a trim should take place (to the greater, lesser, or both sides of a given reference point)  
enum  TrimError { NoTrimError = 0, HitDataArtMustMatchTrimPathArtError = 10, TrimPathIsClosedError = 20, TrimPathNeedsAtLeast2PointsError = 30, InvalidSourcePathForTrimming = 40 } 
Describes various errors that can occur when trimming a path.  
enum  ExtendError { NoExtendError = 0, HitDataArtMustMatchExtendPathArtError = 110, NoExtendIntersectionsFoundError = 120, ExtendPathEndSegmentsOnlyError = 130, ExtendPathIsClosedError = 140, ExtendPathNeedsAtLeast2PointsError = 150, InvalidSourcePathForExtending = 160 } 
Describes various errors that can occur when trimming a path.  
enum  StrokeAlignment { UnknownStrokeAlignment = 0, CenterStrokeAlignment = 10, InsideStrokeAlignment = 20, OutsideStrokeAlignment = 30 } 
Describes how a path's stroke should be aligned.  
typedef std::vector< ArtboardSegPoint >  ArtboardSegPointVector 
typedef std::vector< HitData *>  HitDataVector 
Public Member Functions  
~PathArt ()  
Destructs a PathArt object. More...  
bool  isGuide () const 
Gets whether the path is a guide. More...  
bool  closed () const 
Gets whether the target path is closed. More...  
void  setClosed (const bool closed_) 
Sets whether the target path is closed. More...  
PathStyle  style () const 
Gets the target path's style. More...  
void  setStyle (const PathStyle &style_) 
Sets the target path's style. More...  
int16_t  segCount () const 
Gets the count of segments in the path, taking into account phantom segments of closed paths. More...  
int16_t  segPointCount () const 
Gets the count of individual segment points in the path. More...  
void  setSegCount (const int16_t count_) 
Sets the count of segments in the path. More...  
void  setSegPointCount (const int16_t count_) 
Sets the count of individual segment points in the path. More...  
std::auto_ptr< hdi::core::Bezier >  bezier (const int16_t segIndex_) const 
Gets a Bezier object for a given segment index. More...  
ArtboardPoint  midPoint () const 
Gets the midpoint along a path. More...  
void  endPoints (ArtboardPoint &start__, ArtboardPoint &end__) const 
Gets the end points of a path. More...  
bool  hasLength () const 
Gets whether the path has any length. More...  
double  length () const 
Gets the total length of the path. More...  
double  sublength (const int16_t startSegPt_, const int16_t endSegPt_) const 
Gets the length of a subpath from one segment point to another. More...  
double  sublength (const int16_t startSeg_, const double startT_, const int16_t endSeg_, const double endT_) const 
Gets the length of a subpath, from segment point at a tvalue to another. More...  
double  tAtLength (const int16_t segNum_, const double length_) const 
Gets the tvalue at a given length of a given path segment. More...  
double  area () const 
Gets the area of the path. More...  
bool  hasStraightSegs () const 
Gets whether each individual path segment is straight. More...  
bool  isStraight () const 
Gets whether the entire path forms a perfectly straight line. More...  
bool  isRectangular () const 
Gets whether the entire path forms a rectangular shape. More...  
bool  isCircular () const 
Gets whether the entire path forms a circle. More...  
bool  angle (Angle &angle__) const 
Gets the angle of the path relative to the xaxis, if the path is a perfectly straight line. More...  
ArtboardSegPointVector  segs (const int16_t segIndex_, const int16_t count_) const 
Gets a series of points describing the requested path segments. More...  
ArtboardSegPointVector  segPoints (const int16_t segPtIndex_, const int16_t count_) const 
Gets a series of path segment points. More...  
ArtboardSegPointVector  phantomSeg () const 
Gets two segment points describing the phantom segment of a path. More...  
ArtboardSegPointVector  phantomSegPoints () const 
Gets the two phantom segment points. More...  
void  setSegs (const int16_t segIndex_, const ArtboardSegPointVector &segPts_) 
Sets a series of segments in the path to new values. More...  
void  setSegPoints (const int16_t segPtIndex_, const ArtboardSegPointVector &segPts_) 
Sets a series of segment points in the path to new values. More...  
bool  allSegPointsSelected () const 
Gets whether all the segments points of a path are selected. More...  
bool  segSelected (const int16_t segIndex_) const 
Gets whether a given segment is selected. More...  
SegPointSelectionState  segPointSelected (const int16_t segPtIndex_) const 
Gets the selection state of a given segment point. More...  
bool  setSegPointSelected (const int16_t segPtIndex_, const SegPointSelectionState selected_) 
Sets the selection state of a given segment point. More...  
void  insertSegs (const int16_t segIndex_, const ArtboardSegPointVector &segPts_) 
Inserts new segments into the target path at a given segment index. More...  
void  insertSegPoints (const int16_t segPtIndex_, const ArtboardSegPointVector &segPts_) 
Inserts new segment points into the target path after a given segment point index. More...  
void  deleteSegs (const int16_t segIndex_, const int16_t count_) 
Deletes a given number of segments from a given segment index forward. More...  
void  deleteSegPoints (const int16_t segPtIndex_, const int16_t count_) 
Deletes a given number of segment points from a given segment point index forward. More...  
void  rotateSegPoints (const int16_t delta_) 
Rotates segment point indices by a given delta, while keeping the points at the same location in space. More...  
void  reverseSegs () 
Reverses the winding order of the segment points in the path. More...  
WindingOrderType  windingOrder () const 
Gets the winding order of the path. More...  
void  setWindingOrder (const WindingOrderType winding_) 
Sets the winding order of the path. More...  
void  setStrokeAlignment (const StrokeAlignment align_) 
Sets the stroke alignment for the target path. More...  
void  insertSegPointAtT (const int16_t segIndex_, const double t_) 
"Safely" inserts a new segment point in a given segment More...  
int16_t  segPointClosestToPoint (const ArtboardPoint &pt_) const 
Gets the index of the segment point that is closest to a given point in space. More...  
bool  containsPoint (const ArtboardPoint &pt_) const 
Gets whether a given point is contained inside the path. More...  
HitDataVector  getIntersections (const bool guides_=false) const 
Gets all path segment intersections along the target path. More...  
HitDataVector  getIntersections (const Art &target_, const bool guides_=false) const 
Gets path segment intersections along the target path. More...  
TrimError  trim (const HitData ¢er_, const bool delete_, const TrimDirectionType dir_, const bool guides_, Art &split__) 
Trims a path around a given "center" point, either to one or both sides. More...  
ExtendError  extend (const HitData &from_, const HitData &to_, const bool guides_) 
Extends a path from a given "point" to another "point". More...  
Static Public Attributes  
static const int16_t  maxSegments = 32000 
Maximum number of segments allowed in a path.  
Friends  
class  Art 
Allows for path manipulation, metadata access, trimming, extending, etc.
Describes how an individual segment point is selected, if at all.
hdi::core::PathArt::~PathArt  (  ) 
Destructs a PathArt object.
bool hdi::core::PathArt::allSegPointsSelected  (  )  const 
Gets whether all the segments points of a path are selected.
bool hdi::core::PathArt::angle  (  Angle &  angle__  )  const 
Gets the angle of the path relative to the xaxis, if the path is a perfectly straight line.
angle__  Returnbyreference for the angle of the path 
double hdi::core::PathArt::area  (  )  const 
Gets the area of the path.
std::auto_ptr<hdi::core::Bezier> hdi::core::PathArt::bezier  (  const int16_t  segIndex_  )  const 
bool hdi::core::PathArt::closed  (  )  const 
Gets whether the target path is closed.
bool hdi::core::PathArt::containsPoint  (  const ArtboardPoint &  pt_  )  const 
Gets whether a given point is contained inside the path.
pt_  The point in question 
void hdi::core::PathArt::deleteSegPoints  (  const int16_t  segPtIndex_, 
const int16_t  count_  
) 
Deletes a given number of segment points from a given segment point index forward.
segPtIndex_  Index number of the first segment point to delete 
count_  Number of segment points to delete from segIndex_ forward (inclusive) 
void hdi::core::PathArt::deleteSegs  (  const int16_t  segIndex_, 
const int16_t  count_  
) 
Deletes a given number of segments from a given segment index forward.
segIndex_  Index number of the first segment to delete 
count_  Number of segments to delete from segIndex_ forward (inclusive) 
void hdi::core::PathArt::endPoints  (  ArtboardPoint &  start__, 
ArtboardPoint &  end__  
)  const 
Gets the end points of a path.
start__  Returnbyreference for the start point (i.e. segment index 0, tvalue 0.0) 
end__  Returnbyreference for the end point (i.e. segment index n1, tvalue 1.0) 
ExtendError hdi::core::PathArt::extend  (  const HitData &  from_, 
const HitData &  to_,  
const bool  guides_  
) 
Extends a path from a given "point" to another "point".
from_  HitData object describing the point from which the extension should take place 
to_  HitData object describing the path and segment to which the target should be extended 
guides_  Whether guides should be included when extending 
HitDataVector hdi::core::PathArt::getIntersections  (  const bool  guides_ = false  )  const 
Gets all path segment intersections along the target path.
guides_  Whether guides should be included in the search 
HitDataVector hdi::core::PathArt::getIntersections  (  const Art &  target_, 
const bool  guides_ = false 

)  const 
Gets path segment intersections along the target path.
This method only gets intersections between a path and a provided target piece of art
target_  Piece of art to check against for intersections with the target path 
guides_  Whether guides should be included in the search 
bool hdi::core::PathArt::hasLength  (  )  const 
Gets whether the path has any length.
bool hdi::core::PathArt::hasStraightSegs  (  )  const 
Gets whether each individual path segment is straight.
void hdi::core::PathArt::insertSegPointAtT  (  const int16_t  segIndex_, 
const double  t_  
) 
"Safely" inserts a new segment point in a given segment
segIndex_  Index number of the segment in which the new point will be added 
t_  Tvalue along the given path segment at which the new point will be added 
void hdi::core::PathArt::insertSegPoints  (  const int16_t  segPtIndex_, 
const ArtboardSegPointVector &  segPts_  
) 
Inserts new segment points into the target path after a given segment point index.
segPtIndex_  Segment point index, after which the new seg points will be inserted 
segPts_  Vector of new segment points 
void hdi::core::PathArt::insertSegs  (  const int16_t  segIndex_, 
const ArtboardSegPointVector &  segPts_  
) 
Inserts new segments into the target path at a given segment index.
segIndex_  Segment index, in which the new segs will start 
segPts_  Vector of new segment points describing the segments 
bool hdi::core::PathArt::isCircular  (  )  const 
Gets whether the entire path forms a circle.
bool hdi::core::PathArt::isGuide  (  )  const 
Gets whether the path is a guide.
bool hdi::core::PathArt::isRectangular  (  )  const 
Gets whether the entire path forms a rectangular shape.
bool hdi::core::PathArt::isStraight  (  )  const 
Gets whether the entire path forms a perfectly straight line.
double hdi::core::PathArt::length  (  )  const 
Gets the total length of the path.
ArtboardPoint hdi::core::PathArt::midPoint  (  )  const 
Gets the midpoint along a path.
ArtboardSegPointVector hdi::core::PathArt::phantomSeg  (  )  const 
Gets two segment points describing the phantom segment of a path.
ArtboardSegPointVector hdi::core::PathArt::phantomSegPoints  (  )  const 
Gets the two phantom segment points.
void hdi::core::PathArt::reverseSegs  (  ) 
Reverses the winding order of the segment points in the path.
void hdi::core::PathArt::rotateSegPoints  (  const int16_t  delta_  ) 
Rotates segment point indices by a given delta, while keeping the points at the same location in space.
delta_  The number of positions to move each segment point 
int16_t hdi::core::PathArt::segCount  (  )  const 
Gets the count of segments in the path, taking into account phantom segments of closed paths.
int16_t hdi::core::PathArt::segPointClosestToPoint  (  const ArtboardPoint &  pt_  )  const 
Gets the index of the segment point that is closest to a given point in space.
pt_  The point in question 
int16_t hdi::core::PathArt::segPointCount  (  )  const 
Gets the count of individual segment points in the path.
ArtboardSegPointVector hdi::core::PathArt::segPoints  (  const int16_t  segPtIndex_, 
const int16_t  count_  
)  const 
Gets a series of path segment points.
segPtIndex_  Index number of the first segment point in question 
count_  Number of segment points requested from segIndex_ forward (inclusive) 
SegPointSelectionState hdi::core::PathArt::segPointSelected  (  const int16_t  segPtIndex_  )  const 
Gets the selection state of a given segment point.
segPtIndex_  Index number of the segment point in question 
ArtboardSegPointVector hdi::core::PathArt::segs  (  const int16_t  segIndex_, 
const int16_t  count_  
)  const 
Gets a series of points describing the requested path segments.
segIndex_  Index number of the first segment in question 
count_  Number of segments requested from segIndex_ forward (inclusive) 
bool hdi::core::PathArt::segSelected  (  const int16_t  segIndex_  )  const 
Gets whether a given segment is selected.
segIndex_  Index number of the segment in question 
void hdi::core::PathArt::setClosed  (  const bool  closed_  ) 
Sets whether the target path is closed.
closed_  true to close the path, false to open it 
void hdi::core::PathArt::setSegCount  (  const int16_t  count_  ) 
Sets the count of segments in the path.
count_  New segment count 
void hdi::core::PathArt::setSegPointCount  (  const int16_t  count_  ) 
Sets the count of individual segment points in the path.
count_  New segment point count 
void hdi::core::PathArt::setSegPoints  (  const int16_t  segPtIndex_, 
const ArtboardSegPointVector &  segPts_  
) 
Sets a series of segment points in the path to new values.
segPtIndex_  Index number of the first segment point to set 
segPts_  Vector of new segment points 
bool hdi::core::PathArt::setSegPointSelected  (  const int16_t  segPtIndex_, 
const SegPointSelectionState  selected_  
) 
Sets the selection state of a given segment point.
segPtIndex_  Index number of the segment point in question 
selected_  New segment point selection state enum value 
void hdi::core::PathArt::setSegs  (  const int16_t  segIndex_, 
const ArtboardSegPointVector &  segPts_  
) 
Sets a series of segments in the path to new values.
segIndex_  Index number of the first segment to set 
segPts_  Vector of new segment points describing the segments 
void hdi::core::PathArt::setStrokeAlignment  (  const StrokeAlignment  align_  ) 
Sets the stroke alignment for the target path.
align_  New stroke alignment setting 
void hdi::core::PathArt::setStyle  (  const PathStyle &  style_  ) 
Sets the target path's style.
style_  New path styling info 
void hdi::core::PathArt::setWindingOrder  (  const WindingOrderType  winding_  ) 
Sets the winding order of the path.
winding_  New path winding order 
PathStyle hdi::core::PathArt::style  (  )  const 
Gets the target path's style.
double hdi::core::PathArt::sublength  (  const int16_t  startSegPt_, 
const int16_t  endSegPt_  
)  const 
Gets the length of a subpath from one segment point to another.
startSegPt_  Starting segment point number for calculating path length 
endSegPt_  Ending segment point number for calculating path length 
double hdi::core::PathArt::sublength  (  const int16_t  startSeg_, 
const double  startT_,  
const int16_t  endSeg_,  
const double  endT_  
)  const 
Gets the length of a subpath, from segment point at a tvalue to another.
startSeg_  Starting segment point number for calculating path length 
startT_  Tvalue along startSeg_ seg to begin the calculation 
endSeg_  Ending segment point number for calculating path length 
endT_  Tvalue along endSeg_ seg to end the calculation 
double hdi::core::PathArt::tAtLength  (  const int16_t  segNum_, 
const double  length_  
)  const 
Gets the tvalue at a given length of a given path segment.
segNum_  Segment number in which the given sublength resides 
length_  Length within the given segment number for which a tvalue is desired 
TrimError hdi::core::PathArt::trim  (  const HitData &  center_, 
const bool  delete_,  
const TrimDirectionType  dir_,  
const bool  guides_,  
Art &  split__  
) 
Trims a path around a given "center" point, either to one or both sides.
center_  HitData object describing the "center" from which the trims will take place 
delete_  Whether portion(s) of the path beyond the intersection(s) should be deleted 
dir_  Which direction the trim(s) should take place 
guides_  Whether guides should be taken into account for trimming 
split__  Returnbyreference for the second piece of path art, if necessary 
WindingOrderType hdi::core::PathArt::windingOrder  (  )  const 
Gets the winding order of the path.