Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreHitData.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_HIT_DATA__
8#define __HDI_CORE_HIT_DATA__
9
10#if defined(HDI_CORE_AIP_MODE)
11
13#include "hdicoreTypes.h"
14
15namespace hdi
16{
17 namespace aip
18 {
19 class HitData;
20 }
21
22 namespace core
23 {
24 class Art;
25 class Bezier;
26 class TextRange;
27
31 class HitData
32 {
33 public:
41 {
42 NothingHit = 0, // Any hit request might result in this, if nothing is hit
43 SegPointHit = 10, // SegPointRequest, AnySegControlRequest, SegPointOrInteriorRequest, etc.
44 SegInPointHit = 20, // SegInPointRequest, AnySegControlRequest, AnyHitRequestNoGuides, etc.
45 SegOutPointHit = 30, // SegOutPointRequest, AnySegControlRequest, AnyHitRequestNoGuides, etc.
46 SegInteriorHit = 40, // SegInteriorRequest, SegPointOrInteriorRequest, etc.
47 FillHit = 50 // FillRequest, AnyHitRequestNoGuides, AnyHitRequest
48 };
49
62
70 HitData(const HitData& hitData_);
71
93 const Art* const art_,
94 const ArtboardPoint& pt_,
95 const HitRequest request_,
96 const double tolerance_ = 2.0,
97 const bool adjustToZoom_ = true
98 );
99
105 virtual ~HitData();
106
114 virtual bool isEmpty() const;
115
124 virtual HitData& operator=(const HitData& rhs_);
125
134 virtual bool operator==(const HitData& rhs_) const;
135
144 virtual bool operator!=(const HitData& rhs_) const;
145
154 virtual HitRequest request() const;
155
163 virtual bool hit() const;
164
172 virtual HitType hitType() const;
173
181 virtual std::unique_ptr<Art> art() const;
182
194 virtual int16_t segPointIndex() const;
195
209 virtual int16_t segIndex() const;
210
222 virtual double tValue() const;
223
233 virtual ArtboardPoint point() const;
234
242 virtual std::unique_ptr<Bezier> bezier() const;
243
252 virtual std::unique_ptr<TextRange> textRange() const;
253
265 virtual bool snapForHit(ArtboardPoint& pt__) const;
266
280 virtual bool snapForHitType(const HitType type_, ArtboardPoint& pt__) const;
281
282
283 private:
284 friend aip::HitData* __accessImpl(const HitData&);
285 friend HitData __accessCtor(const aip::HitData&);
286
290 void* __data;
291
297 void* __impl() const;
298
304 HitData(const aip::HitData&);
305 };
306
307 typedef std::unique_ptr<HitData> HitDataUP;
308 typedef std::shared_ptr<HitData> HitDataSP;
309 typedef std::weak_ptr<HitData> HitDataWP;
310
311 extern aip::HitData* __accessImpl(const HitData&);
312 extern HitData __accessCtor(const aip::HitData&);
313 }
314}
315
316#endif
317// HDI_CORE_AIP_MODE
318
319#endif
320// __HDI_CORE_HIT_DATA__
Handles general art-related functionality.
Definition: hdicoreArt.h:51
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:31
Allows for hit data creation, metadata access, snapping, etc.
Definition: hdicoreHitData.h:32
virtual HitType hitType() const
Gets the type of hit detected.
virtual ~HitData()
Destructs a HitData object.
virtual int16_t segPointIndex() const
Gets the segment point hit.
virtual bool operator!=(const HitData &rhs_) const
Tests whether a given HitData object is not the same as another.
virtual HitRequest request() const
Gets the original type of hit test performed.
virtual std::unique_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)
virtual int16_t segIndex() const
Gets the segment number of a path that was hit.
virtual bool operator==(const HitData &rhs_) const
Tests whether a given HitData object is the same as another.
virtual double tValue() const
Gets the t-value of the hit along a path.
virtual bool hit() const
Reports whether some art was hit.
virtual ArtboardPoint point() const
Gets the point hit.
virtual bool snapForHit(ArtboardPoint &pt__) const
Convenience method to modify and "snap" a given point if a hit has occurred.
virtual std::unique_ptr< TextRange > textRange() const
Gets the text range that was hit (preset to the range of the character that is at the hit point)
HitType
Describes the type hit that was actually detected from a request.
Definition: hdicoreHitData.h:41
virtual std::unique_ptr< Art > art() const
Gets the art that was hit (or NULL if none)
HitData()
Constructs an empty HitData object.
HitData(const HitData &hitData_)
Constructs a HitData object from an existing HitData object (copy constructor)
HitData(const Art *const art_, const ArtboardPoint &pt_, const HitRequest request_, const double tolerance_=2.0, const bool adjustToZoom_=true)
Constructs a HitData object from a hit test, with an optional tolerance and zoom adjustment.
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 HitData & operator=(const HitData &rhs_)
Assigns one HitData object to another.
Header file for geometric point manipulation on the Illustrator artboard.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
HitRequest
Describes the types of hit tests that can be performed (AKA a hit request)
Definition: hdicoreTypes.h:348