Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
hdicoreHitData.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_HIT_DATA__
8 #define __HDI_CORE_HIT_DATA__
9 
10 #include "hdicoreArtboardPoint.h"
11 #include "hdicoreTypes.h"
12 
13 namespace hdi
14 {
15  namespace plugin
16  {
17  class HitData;
18  }
19 
20  namespace core
21  {
22  class Art;
23  class Bezier;
24  class TextRange;
25 
29  class HitData
30  {
31  public:
38  enum HitType
39  {
40  NothingHit = 0, // Any hit request might result in this, if nothing is hit
41  SegPointHit = 10, // SegPointRequest, AnySegControlRequest, SegPointOrInteriorRequest, etc.
42  SegInPointHit = 20, // SegInPointRequest, AnySegControlRequest, AnyHitRequestNoGuides, etc.
43  SegOutPointHit = 30, // SegOutPointRequest, AnySegControlRequest, AnyHitRequestNoGuides, etc.
44  SegInteriorHit = 40, // SegInteriorRequest, SegPointOrInteriorRequest, etc.
45  FillHit = 50 // FillRequest, AnyHitRequestNoGuides, AnyHitRequest
46  };
47 
59  HitData();
60 
68  HitData(const HitData& hitData_);
69 
90  HitData(
91  const Art* const art_,
92  const ArtboardPoint& pt_,
93  const HitRequest request_,
94  const double tolerance_ = 2.0,
95  const bool adjustToZoom_ = true
96  );
97 
103  virtual ~HitData();
104 
112  virtual bool isEmpty() const;
113 
122  virtual HitData& operator=(const HitData& rhs_);
123 
132  virtual bool operator==(const HitData& rhs_) const;
133 
142  virtual bool operator!=(const HitData& rhs_) const;
143 
152  virtual HitRequest request() const;
153 
161  virtual bool hit() const;
162 
170  virtual HitType hitType() const;
171 
179  virtual std::auto_ptr<Art> art() const;
180 
192  virtual int16_t segPointIndex() const;
193 
207  virtual int16_t segIndex() const;
208 
220  virtual double tValue() const;
221 
231  virtual ArtboardPoint point() const;
232 
240  virtual std::auto_ptr<Bezier> bezier() const;
241 
250  virtual std::auto_ptr<TextRange> textRange() const;
251 
263  virtual bool snapForHit(ArtboardPoint& pt__) const;
264 
278  virtual bool snapForHitType(const HitType type_, ArtboardPoint& pt__) const;
279 
280 
281  private:
282  friend plugin::HitData* __accessImpl(const HitData&);
283  friend HitData __accessCtor(const plugin::HitData&);
284 
288  void* __data;
289 
295  void* __impl() const;
296 
302  HitData(const plugin::HitData&);
303  };
304 
305  typedef std::auto_ptr<HitData> HitDataAP;
306 
307  extern plugin::HitData* __accessImpl(const HitData&);
308  extern HitData __accessCtor(const plugin::HitData&);
309  }
310 }
311 
312 #endif
313 // __HDI_CORE_HIT_DATA__
Handles general art-related functionality.
Definition: hdicoreArt.h:48
bool bezier(const SegPointVector &segPts_, const bool fill_=false)
Draws a bezier from the given segment points.
HitRequest
Describes the types of hit tests that can be performed (AKA a hit request)
Definition: hdicoreTypes.h:326
Allows for hit data creation, metadata access, snapping, etc.
Definition: hdicoreHitData.h:29
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Header file for geometric point manipulation on the Illustrator artboard.
Definition: hdicoreaiArray.h:12
HitType
Describes the type hit that was actually detected from a request.
Definition: hdicoreHitData.h:38
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:28