Adobe.com
Contents Suites Classes Class Index Member Index

AIHitTest.h

Go to the documentation of this file.
00001 #ifndef __AIHitTest__
00002 #define __AIHitTest__
00003 
00004 /*
00005  *        Name: AIHitTest.h
00006  *      Author:
00007  *        Date:
00008  *     Purpose: Adobe Illustrator Hit Testing Suite.
00009  *
00010  * ADOBE SYSTEMS INCORPORATED
00011  * Copyright 1986-2009 Adobe Systems Incorporated.
00012  * All rights reserved.
00013  *
00014  * NOTICE:  Adobe permits you to use, modify, and distribute this file 
00015  * in accordance with the terms of the Adobe license agreement 
00016  * accompanying it. If you have received this file from a source other 
00017  * than Adobe, then your use, modification, or distribution of it 
00018  * requires the prior written permission of Adobe.
00019  *
00020  */
00021 
00022 
00023 /*******************************************************************************
00024  **
00025  **     Imports
00026  **
00027  **/
00028 
00029 #ifndef __AIPluginGroup__
00030 #include "AIPluginGroup.h"
00031 #endif
00032 #ifndef __AITool__
00033 #include "AITool.h"
00034 #endif
00035 
00036 #include "AIHeaderBegin.h"
00037 
00040 /*******************************************************************************
00041  **
00042  ** Constants
00043  **
00044  **/
00045 
00046 #define kAIHitTestSuite                         "AI Hit Test Suite"
00047 #define kAIHitTestSuiteVersion19        AIAPI_VERSION(7)
00048 #define kAIHitTestSuiteVersion          kAIHitTestSuiteVersion19
00049 #define kAIHitTestVersion                       kAIHitTestSuiteVersion
00050 
00051 
00054 enum AIHitType {
00056         kPHitType,
00058         kInHitType,
00060         kOutHitType,
00062         kSegmentHitType,
00064         kFillHitType,
00066         kCenterHitType,
00068         kTwoGuideHitType
00069 };
00070 
00072 enum AIHitRequest {
00074         kAllHitRequest,
00076         kPHitRequest,
00078         kEndPHitRequest,
00080         kGuideHitRequest,
00082         kNearestPointOnPathHitRequest,
00084         kTextHitRequest,
00086         kSelectedObjectHitRequest,
00088         kPaintHitRequest,
00090         kAllNoFillHitRequest,
00093         kPaintNoFillHitRequest,
00096         kNoControlHandlesHitRequest,
00099         kNoLockedPaintHitRequest,
00101         kAllPHitRequest,
00104         kAllHitPreviewRequest,
00109         kStrokeHitRequest
00110 };
00111 
00112 
00113 /*******************************************************************************
00114  **
00115  ** Types
00116  **
00117  **/
00118 
00126 typedef struct AIHit                    *AIHitRef;
00127 
00131 struct AIToolHitData {
00134         AIBoolean hit;
00137         ai::int16 type;
00141         ai::int16 subType;
00145         ai::int16  segment;
00148         AIArtHandle object;
00151         AIArtHandle group;
00155         AIRealPoint point;
00159         AIReal t;
00160         AIToolHitData():hit(false),
00161                                         type(0),
00162                                         subType(0),
00163                                         segment(0),
00164                                         object(NULL),
00165                                         group(NULL),
00166                                         point(),
00167                                         t(0.0)
00168         {
00169         }
00170 };
00171 
00172 
00173 /*******************************************************************************
00174  **
00175  **     Suite
00176  **
00177  **/
00178 
00186 struct AIHitTestSuite {
00202         AIAPI AIErr (*HitTest) ( AIArtHandle art, const AIRealPoint *point, ai::int32 option, AIHitRef *hit );
00203 
00219         AIAPI AIErr (*HitTestEx) ( AIArtHandle art, const AIRealPoint *point, AIReal tolerance, ai::int32 option, AIHitRef *hit );
00220 
00228         AIAPI ai::int32 (*AddRef) ( AIHitRef hit );
00229 
00236         AIAPI ai::int32 (*Release) ( AIHitRef hit );
00237 
00243         AIAPI AIErr (*GetHitData) ( AIHitRef hit, AIToolHitData *toolHit );
00244 
00250         AIAPI AIBoolean (*IsHit) ( AIHitRef hit );
00251 
00258         AIAPI ai::int32 (*GetType) ( AIHitRef hit );
00259 
00268         AIAPI ai::int32(*GetSubType) (AIHitRef hit);
00269 
00276         AIAPI AIArtHandle (*GetArt) ( AIHitRef hit );
00277 
00284         AIAPI AIArtHandle (*GetGroup) ( AIHitRef hit );
00285 
00294         AIAPI AIRealPoint (*GetPoint) ( AIHitRef hit );
00295 
00304         AIAPI ai::int16(*GetPathSegment) ( AIHitRef hit );
00305 
00314         AIAPI AIReal (*GetPathParameter) ( AIHitRef hit );
00315 
00316         // New for AI12:
00317 
00341         AIAPI AIErr (*CustomHitTest) ( AIArtHandle art, const AIRealPoint *point, AIReal tolerance, ai::int32 option,
00342                                                                    AIPluginGroupHandle pluginGroup, void* extData, AIHitRef *hit );
00343 
00357         AIAPI AIErr (*GetCustomHitData) ( AIHitRef hit, void** userdata, AIArtHandle *pluginObject );
00358 
00359         // New for AI15:
00360 
00376         AIAPI AIReal (*GetSignedHitDistance) ( AIHitRef hit );
00377 };
00378 
00379 #include "AIHeaderEnd.h"
00380 
00381 
00382 #endif


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks