Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #pragma once
00018 #include "coreexp.h"
00019 #include "maxheap.h"
00020 #include "baseinterface.h"
00021 #include "point3.h"
00022 #include "ipoint3.h"
00023 #include "box2.h"
00024 #include "box3.h"
00025
00026
00027 class Osnap;
00028 class HitMesh;
00029 class OsnapMarker;
00030 class ViewExp;
00031 class INode;
00032
00044 class OsnapHit : public BaseInterfaceServer
00045 {
00046 friend class OsnapManager;
00047 friend class Osnap;
00048 friend class TypedHit;
00049 public:
00061 CoreExport OsnapHit(Point3 p3, Osnap* s, int sub, HitMesh *m);
00062 CoreExport OsnapHit(Point3 pt);
00068 CoreExport OsnapHit(const OsnapHit& h);
00073 CoreExport virtual OsnapHit& operator=(const OsnapHit& h);
00076 CoreExport virtual ~OsnapHit();
00080 CoreExport virtual OsnapHit* clone();
00081
00089 void setscreendata(IPoint3 screen3, int len);
00090
00092
00094
00109 CoreExport virtual boolean display(ViewExp *vpt, TimeValue t, Point3 color, \
00110 int markersize, boolean markers = TRUE, boolean hilite = TRUE);
00112 CoreExport void erase(ViewExp *vpt, TimeValue t) const;
00124 CoreExport void GetViewportRect(TimeValue t, ViewExp* vpt, Rect* rect, int marksize) const;
00125
00127
00129
00130 CoreExport Point3 GetHitpoint(){return hitpoint;};
00132 CoreExport Point3 GetWorldHitpoint(){return worldpoint;};
00135 CoreExport IPoint3 GetHitscreen(){return m_hitscreen;};
00137 CoreExport int GetSubsnap(){return subsnap;}
00138 CoreExport POINT GetCursor(){return m_cursor;}
00140 INode* GetNode(){return node;}
00145 void Dump()const;
00146
00148
00150
00158 CoreExport BOOL operator<(OsnapHit& hit);
00166 CoreExport BOOL operator>(OsnapHit& hit);
00167
00168 public:
00170 void Update(TimeValue t);
00180 CoreExport Point3 ReEvaluate(TimeValue t);
00181 virtual bool IsWorldSpaceHit(){return false;}
00182
00183
00184 private:
00185 Point3 hitpoint;
00186 Point3 worldpoint;
00187 IPoint3 m_hitscreen;
00188 POINT m_cursor;
00189 int m_len;
00190 int m_z_depth;
00191 BOOL m_complete;
00192 Osnap* snap;
00193 int subsnap;
00194 OsnapMarker *m_pmarker;
00195
00196 INode* node;
00197 HitMesh *hitmesh;
00198
00199 ViewExp *m_vpt;
00200
00201 BOOL m_invisible;
00202 };
00203
00204
00219 class HitMesh: public MaxHeapOperators
00220 {
00221 private:
00222 int m_numverts;
00223 Point3 *m_pverts;
00224 static long m_cref;
00225 public:
00228 CoreExport HitMesh();
00230 CoreExport ~HitMesh();
00236 CoreExport HitMesh(const HitMesh& h);
00244 CoreExport HitMesh(int n);
00249 Point3 operator[](int i){return m_pverts[i];}
00251 int getNumVerts(){return m_numverts;}
00257 CoreExport void setNumVerts(int n);
00281 void setVert(int i, const Point3 &xyz){ m_pverts[i] = xyz; }
00283 Point3& getVert(int i){return m_pverts[i];}
00287 Point3* getVertPtr(){return m_pverts;}
00288 };
00289
00290
00291 class TypedHit: public OsnapHit
00292 {
00293 public:
00294 TypedHit(Point3 pt);
00295 virtual boolean display(ViewExp *vpt, TimeValue t, Point3 color, \
00296 int markersize, boolean markers = TRUE, boolean hilite = TRUE);
00297 virtual bool IsWorldSpaceHit(){return true;}
00298 };