Hot Door CORE  0.7.0
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__
virtual std::auto_ptr< Bezier > bezier() const
Gets the bezier for the segment hit.
virtual bool isEmpty() const
Gets whether the target HitData object is empty (constructed with the default ctor) ...
Handles general art-related functionality.
Definition: hdicoreArt.h:47
virtual std::auto_ptr< TextRange > textRange() const
Gets the text range that was hit (preset to the range of the character that is at the hit point) ...
Allows for hit data creation, metadata access, snapping, etc.
Definition: hdicoreHitData.h:29
virtual bool operator!=(const HitData &rhs_) const
Tests whether a given HitData object is not the same as another.
virtual bool snapForHit(ArtboardPoint &pt__) const
Convenience method to modify and "snap" a given point if a hit has occurred.
virtual double tValue() const
Gets the t-value of the hit along a path.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
virtual HitRequest request() const
Gets the original type of hit test performed.
Header file for geometric point manipulation on the Illustrator artboard.
virtual HitType hitType() const
Gets the type of hit detected.
virtual bool hit() const
Reports whether some art was hit.
Definition: hdicoreaiArray.h:12
virtual int16_t segPointIndex() const
Gets the segment point hit.
virtual ArtboardPoint point() const
Gets the point hit.
virtual bool snapForHitType(const HitType type_, ArtboardPoint &pt__) const
Convenience method to modify and "snap" a given point only if a certain type of hit has occurred...
virtual bool operator==(const HitData &rhs_) const
Tests whether a given HitData object is the same as another.
virtual std::auto_ptr< Art > art() const
Gets the art that was hit (or NULL if none)
HitData()
Constructs an empty HitData object.
HitType
Describes the type hit that was actually detected from a request.
Definition: hdicoreHitData.h:38
virtual ~HitData()
Destructs a HitData object.
virtual HitData & operator=(const HitData &rhs_)
Assigns one HitData object to another.
virtual int16_t segIndex() const
Gets the segment number of a path that was hit.
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:28