00001
00002
00003 #pragma once
00004
00005 #include "object.h"
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 #include "maxheap.h"
00110 #include "iFnPub.h"
00111 #include "icurvctl.h"
00112
00113
00114 #define PAINTERINTERFACE_V5 0x78ffe181
00115 #define PAINTERINTERFACE_V7 0x78ffe182
00116 #define PAINTERINTERFACE_V14 0x78ffe183
00117 #define PAINTERCANVASINTERFACE_V5 0x29ff7ac9
00118 #define PAINTERCANVASINTERFACE_V5_1 0x29ff7ad0
00119 #define PAINTERCANVASINTERFACE_V7 0x1e962374
00120
00121 #define PAINTERINTERFACE_CLASS_ID Class_ID(0x2f2ef7e9, 0x78ffe181)
00122 #define PAINTERINTERFACE_SUPERCLASS_ID REF_TARGET_CLASS_ID
00123
00124 #define PAINTERINTERFACEV5_INTERFACE Interface_ID(0x53b4520c, 0x29ff7ac9)
00125
00126
00127
00128 #define NO_MIRRROR 0
00129 #define MIRRRORED 1
00130 #define MIRRROR_SHARED 2
00131
00132
00137 #define RINGCOLOR 0x445408e0
00138 #define NORMALCOLOR 0x445408e1
00139 #define RINGPRESSEDCOLOR 0x445408e2
00140 #define NORMALPRESSEDCOLOR 0x445408e3
00141 #define TRACECOLOR 0x445408e4
00142 #define GIZMOCOLOR 0x445408e5
00143
00144
00149 #define PRESSURE_AFFECTS_NONE 0
00150 #define PRESSURE_AFFECTS_STR 1
00151 #define PRESSURE_AFFECTS_SIZE 2
00152 #define PRESSURE_AFFECTS_BOTH 3
00153
00154
00155
00161 class IPainterInterface_V5: public MaxHeapOperators
00162 {
00163 public:
00164
00165
00166
00167
00168
00170
00172 virtual BOOL InitializeCallback(ReferenceTarget *canvas) = 0;
00173
00175
00179 virtual BOOL InitializeNodes(int flags, Tab<INode*> &nodeList) = 0;
00180
00182
00191 virtual BOOL UpdateMeshes(BOOL updatePointGather) = 0;
00192
00194 virtual BOOL StartPaintSession() = 0;
00195
00197 virtual BOOL EndPaintSession() = 0;
00198
00199
00201 virtual BOOL InPaintMode()=0;
00202
00204 virtual BOOL BringUpOptions() = 0;
00205
00207
00209 virtual int *RetrieveTimeList(int &ct) = 0;
00210
00211
00212
00213
00215
00229 virtual BOOL TestHit(
00230 IPoint2 mousePos,
00231 Point3 &worldPoint, Point3 &worldNormal,
00232 Point3 &localPoint, Point3 &localNormal,
00233 Point3 &bary, int &index,
00234 INode *node,
00235 BOOL &mirrorOn,
00236 Point3 &worldMirrorPoint, Point3 &worldMirrorNormal,
00237 Point3 &localMirrorPoint, Point3 &localMirrorNormal
00238 ) = 0;
00239
00241
00257 virtual BOOL RandomHit(Point3 &worldPoint, Point3 &worldNormal,
00258 Point3 &localPoint, Point3 &localNormal,
00259 Point3 &bary, int &index,
00260 float &strFromFalloff, INode *node,
00261 BOOL &mirrorOn,
00262 Point3 &worldMirrorPoint, Point3 &worldMirrorNormal,
00263 Point3 &localMirrorPoint, Point3 &localMirrorNormal,
00264 int tabIndex) = 0;
00265
00267
00282 virtual BOOL RandomHitAlongStroke(Point3 &worldPoint, Point3 &worldNormal,
00283 Point3 &localPoint, Point3 &localNormal,
00284 Point3 &bary, int &index,
00285 float &strFromFalloff, INode *node,
00286 BOOL &mirrorOn,
00287 Point3 &worldMirrorPoint, Point3 &worldMirrorNormal,
00288 Point3 &localMirrorPoint, Point3 &localMirrorNormal,
00289 int tabIndex) = 0;
00290
00291
00293
00297 virtual BOOL ClearStroke()=0;
00298
00300
00309 virtual BOOL AddToStroke(IPoint2 mousePos, BOOL rebuildPointGatherData, BOOL updateViewport)=0;
00310
00311
00312
00313
00314
00316 virtual int GetStrokeCount() = 0;
00318 virtual float *GetStrokeStr() = 0;
00320 virtual float *GetStrokeRadius() = 0;
00322 virtual Point3 *GetStrokePointWorld() = 0;
00324 virtual Point3 *GetStrokeNormalWorld() = 0;
00326 virtual Point3 *GetStrokePointWorldMirror() = 0;
00328 virtual Point3 *GetStrokeNormalWorldMirror() = 0;
00331 virtual float *GetStrokePressure() = 0;
00332
00334 virtual Point3 *GetStrokePointLocal() = 0;
00336 virtual Point3 *GetStrokeNormalLocal() = 0;
00338 virtual Point3 *GetStrokePointLocalMirror() = 0;
00340 virtual Point3 *GetStrokeNormalLocalMirror() = 0;
00341
00343 virtual IPoint2 *GetStrokeMousePos() = 0;
00345
00347 virtual BOOL *GetStrokeHitList() = 0;
00348
00350 virtual Point3 *GetStrokeBary() = 0;
00352 virtual int *GetStrokeIndex() = 0;
00353
00355 virtual BOOL *GetStrokeShift() = 0;
00357 virtual BOOL *GetStrokeCtrl() = 0;
00359 virtual BOOL *GetStrokeAlt() = 0;
00360
00362 virtual INode **GetStrokeNode() = 0;
00364 virtual int *GetStrokeTime() = 0;
00365
00366
00368 virtual float GetStrFromPoint(Point3 point) = 0;
00369
00370
00371
00373
00381
00382 virtual float *GetPredefineStrStrokeData(int &ct)=0;
00383
00385
00393 virtual float *GetPredefineSizeStrokeData(int &ct)=0;
00394
00395
00396
00397
00399
00403 virtual BOOL GetBuildNormalData() = 0;
00405
00409 virtual void SetBuildNormalData(BOOL enable) = 0;
00410
00411
00412
00413
00415
00417 virtual BOOL GetEnablePointGather() = 0;
00419
00421 virtual void SetEnablePointGather(BOOL enable) = 0;
00422
00424
00429 virtual BOOL LoadCustomPointGather(int ct, Point3 *points, INode *node) = 0;
00430
00431
00432
00434
00437 virtual float *RetrievePointGatherWeights(INode *node, int &ct) = 0;
00439
00442 virtual float *RetrievePointGatherStr(INode *node, int &ct) = 0;
00444
00447 virtual BOOL *RetrievePointGatherIsMirror(INode *node, int &ct) = 0;
00449
00452 virtual Point3 *RetrievePointGatherPoints(INode *node, int &ct) = 0;
00453
00455
00459 virtual Point3 *RetrievePointGatherNormals(INode *node, int &ct) = 0;
00460
00462
00465 virtual float *RetrievePointGatherU(INode *node, int &ct) = 0;
00466
00467
00468
00469
00470
00472 virtual BOOL GetMirrorEnable() = 0 ;
00474 virtual void SetMirrorEnable(BOOL enable) = 0;
00476
00478 virtual Point3 GetMirrorPlaneCenter() = 0;
00480
00484 virtual int GetMirrorAxis() = 0;
00486
00490 virtual void SetMirrorAxis(int dir) = 0;
00492 virtual float GetMirrorOffset() = 0;
00494 virtual void SetMirrorOffset(float offset) = 0;
00495
00496
00498
00501 virtual int GetTreeDepth() = 0;
00503
00506 virtual void SetTreeDepth(int depth) = 0;
00507
00509
00512 virtual BOOL GetUpdateOnMouseUp() = 0;
00514
00517 virtual void SetUpdateOnMouseUp(BOOL update) = 0;
00518
00520
00523 virtual int GetLagRate() = 0;
00525
00528 virtual void SetLagRate(int lagRate) = 0;
00529
00530
00531
00533
00535 virtual float GetMinStr() = 0;
00537
00539 virtual void SetMinStr(float str) = 0;
00541
00543 virtual float GetMaxStr() = 0;
00545
00547 virtual void SetMaxStr(float str) = 0;
00548
00550
00552 virtual float GetMinSize() = 0;
00554
00556 virtual void SetMinSize(float str) = 0;
00558
00560 virtual float GetMaxSize() = 0;
00562
00564 virtual void SetMaxSize(float str) = 0;
00565
00567
00571 virtual BOOL GetAdditiveMode()=0;
00573
00577 virtual void SetAdditiveMode(BOOL enable)=0;
00580 virtual ICurve *GetFalloffGraph()=0;
00581
00582
00583
00584
00585
00587
00588 virtual BOOL GetDrawRing()=0;
00590
00591 virtual void SetDrawRing(BOOL draw)=0;
00592
00594
00595 virtual BOOL GetDrawNormal()=0;
00597
00598 virtual void SetDrawNormal(BOOL draw)=0;
00599
00601
00602 virtual BOOL GetDrawTrace()=0;
00604
00605 virtual void SetDrawTrace(BOOL draw)=0;
00606
00607
00608
00609
00611
00614 virtual BOOL GetPressureEnable()=0;
00616
00619 virtual void SetPressureEnable(BOOL enable)=0;
00620
00622
00624 virtual BOOL GetPressureAffects()=0;
00626
00628 virtual void SetPressureAffects(int affect)=0;
00629
00631
00632 virtual BOOL GetPredefinedStrEnable()=0;
00634
00635 virtual void SetPredefinedStrEnable(BOOL enable)=0;
00636
00638
00639 virtual BOOL GetPredefinedSizeEnable()=0;
00641
00642 virtual void SetPredefinedSizeEnable(BOOL enable)=0;
00644
00645 virtual ICurve *GetPredefineSizeStrokeGraph()=0;
00647
00648 virtual ICurve *GetPredefineStrStrokeGraph()=0;
00649
00650 virtual float GetNormalScale() = 0;
00651 virtual void SetNormalScale(float scale) = 0;
00652
00653 virtual BOOL GetMarkerEnable() = 0;
00654 virtual void SetMarkerEnable(BOOL on) = 0;
00655 virtual float GetMarker() = 0;
00656 virtual void SetMarker(float pos) = 0;
00657
00659
00663 virtual int GetOffMeshHitType() = 0;
00664
00666
00670 virtual void SetOffMeshHitType(int type) = 0;
00671
00672 virtual float GetOffMeshHitZDepth() = 0;
00673 virtual void SetOffMeshHitZDepth(float depth) = 0;
00674
00675 virtual Point3 GetOffMeshHitPos() = 0;
00676 virtual void SetOffMeshHitPos(Point3 pos) = 0;
00677
00678
00679 };
00680
00687 class FaceDataFromPatch: public MaxHeapOperators
00688 {
00689 public:
00690 int owningPatch;
00691 Point2 st[3];
00692 };
00693
00699 class IPainterRightClickHandler: public MaxHeapOperators
00700 {
00701 public:
00703 virtual void RightClick ()=0;
00704 };
00705
00711 class IPainterInterface_V7 : public IPainterInterface_V5
00712 {
00713 public:
00715
00722 virtual BOOL InitializeNodesByObjState(int flags, Tab<INode*> &nodeList, Tab<ObjectState> &objList) = 0;
00723
00725
00736 virtual BOOL UpdateMeshesByObjState(BOOL updatePointGather, Tab<ObjectState> &objList) = 0;
00737
00740 virtual void GetPatchFaceData(PatchMesh &patch, Tab<FaceDataFromPatch> &faceData) = 0;
00741
00744
00748 virtual BOOL StartPaintSession (IPainterRightClickHandler *rightClicker) = 0;
00749
00751 virtual BOOL StartPaintSession() = 0;
00752
00754 virtual float GetStrDragLimitMin() = 0;
00756 virtual void SetStrDragLimitMin(float l) = 0;
00757
00759 virtual float GetStrDragLimitMax() = 0;
00761 virtual void SetStrDragLimitMax(float l) = 0;
00762
00763
00764 };
00765
00770 class IPainterInterface_V14 : public IPainterInterface_V7
00771 {
00772 public:
00774 virtual BOOL GetUseSplineConstraint() = 0;
00776 virtual void SetUseSplineConstraint(BOOL onoff) = 0;
00779 virtual BOOL SetSplineConstraintNode(INode* snode) = 0;
00781 virtual BOOL IsSplineConstraintNodeValid() = 0;
00782 };
00783
00784
00790 class IPainterCanvasInterface_V5: public MaxHeapOperators
00791 {
00792 public:
00793
00795 virtual BOOL StartStroke() = 0;
00796
00797
00799
00824 virtual BOOL PaintStroke(
00825 BOOL hit,
00826 IPoint2 mousePos,
00827 Point3 worldPoint, Point3 worldNormal,
00828 Point3 localPoint, Point3 localNormal,
00829 Point3 bary, int index,
00830 BOOL shift, BOOL ctrl, BOOL alt,
00831 float radius, float str,
00832 float pressure, INode *node,
00833 BOOL mirrorOn,
00834 Point3 worldMirrorPoint, Point3 worldMirrorNormal,
00835 Point3 localMirrorPoint, Point3 localMirrorNormal
00836 ) = 0;
00837
00839 virtual BOOL EndStroke() = 0;
00840
00842
00845 virtual BOOL EndStroke(int ct, BOOL *hit, IPoint2 *mousePos,
00846 Point3 *worldPoint, Point3 *worldNormal,
00847 Point3 *localPoint, Point3 *localNormal,
00848 Point3 *bary, int *index,
00849 BOOL *shift, BOOL *ctrl, BOOL *alt,
00850 float *radius, float *str,
00851 float *pressure, INode **node,
00852 BOOL mirrorOn,
00853 Point3 *worldMirrorPoint, Point3 *worldMirrorNormal,
00854 Point3 *localMirrorPoint, Point3 *localMirrorNormal ) = 0;
00855
00857 virtual BOOL CancelStroke() = 0;
00858
00860 virtual BOOL SystemEndPaintSession() = 0;
00861
00864 virtual void PainterDisplay(TimeValue t, ViewExp *vpt, int flags) = 0;
00865
00866
00867 };
00868
00869
00876 class IPainterCanvasInterface_V5_1: public MaxHeapOperators
00877 {
00878 public:
00879
00881
00887 virtual void CanvasStartPaint()=0;
00889
00895 virtual void CanvasEndPaint()=0;
00896
00897
00898 };
00899
00901 class IPainterCanvasInterface_V7: public MaxHeapOperators
00902 {
00903 public:
00905
00906 virtual void OnPaintBrushChanged() = 0;
00907 };
00908