omanapi.h

Go to the documentation of this file.
00001 /**********************************************************************
00002     FILE: omanapi.h
00003 
00004     DESCRIPTION:  Defines an interface to the osnapmanager class
00005 
00006     CREATED BY: John Hutchinson
00007     HISTORY: May 14, 1997
00008     Copyright (c) 1994, All Rights Reserved.
00009  **********************************************************************/
00010 #pragma once
00011 
00012 #include "baseinterface.h"
00013 #include "point3.h"
00014 #include "matrix3.h"
00015 
00016 // forward declarations
00017 class Osnap;
00018 class OsnapHit;
00019 class ViewExp;
00020 class INode;
00021 class Point3;
00022 class IPoint3;
00023 struct SnapInfo;
00024 
00025 // Flag masks for user settings
00026 #define SHOW_PREVIEW            (1<<0)
00027 #define HIGHLIGHT_GEOM          (1<<1)
00028 #define HIGHLIGHT_POINT         (1<<2)
00029 #define SHOW_CURSOR                 (1<<3)
00030 #define XYZ_CONSTRAINT          (1<<5)
00031 #define SNAP_FROZEN                 (1<<15)
00032 #define DISPLAY_RUBBER_BAND (1<<20)
00033 
00034 // Flag masks for internal stuff
00035 #define BUFFER_HOLDING          (1<<6)
00036 
00037   
00038 #define IID_IOsnapManager Interface_ID(0x5ba68f3, 0x490c28a2)
00039 
00050 class IOsnapManager :  public BaseInterface
00051 {
00052 public:
00055     virtual BOOL getactive() const =0;
00059     virtual BOOL getAxisConstraint()=0;
00069     virtual void RecordHit(OsnapHit* somehit)=0;
00076     virtual BOOL OKForRelativeSnap()=0;
00079     virtual BOOL RefPointWasSnapped()=0;
00102     virtual Point3 GetRefPoint(BOOL top = TRUE)=0;
00106     virtual BOOL IsHolding()=0;
00109     virtual OsnapHit &GetHit()=0;
00113     virtual ViewExp* GetVpt()=0;
00116     virtual INode* GetNode()=0;
00122     virtual int GetSnapStrength()=0;
00125     virtual Matrix3 GetObjectTM()=0;
00127     virtual TimeValue GetTime()=0;
00135     virtual void wTranspoint(Point3 *inpt, IPoint3 *outpt)=0;
00140     virtual void Reset() =0;
00141     virtual BOOL TestAFlag(int mask)=0;
00142     virtual Point3 GetCurrentPoint()=0;
00143 };
00144 
00145 #define IID_IOsnapManager7 Interface_ID(0x795e7eae, 0x48e02d13)
00146 class IOsnapManager7 :  public IOsnapManager
00147 {
00148 public:
00149     // --- Snap Preview Radius management
00150     // This is the radius of the circular area around the mouse cursor in which 
00151     // the snap point has to be in order to register a hit with the Snap Manager.
00152     // From all the registered hits, the Snap Manager determines the closest to
00153     // the mouse cursor and asks it to highlight ("preview" itself)
00154     virtual int GetSnapPreviewRadius() const = 0; 
00155     virtual void SetSnapPreviewRadius(int nVal) = 0; 
00156 
00157     // --- Snap Radius management
00158     // This is the radius of the circular area around the mouse cursor in which 
00159     // the highlighted snap point has to fall into for the transformed entity to 
00160     // be automatically snapped to that snap point. Note that the entity will 
00161     // always snap to the highlighted snap point when the user starts or finishes 
00162     // transforming the entity
00163     virtual int GetSnapRadius() const = 0; 
00164     virtual void SetSnapRadius(int nVal) = 0; 
00165 
00166     // --- Rubber-Band Display management methods
00167     // These methods allow the toggling of the rubber-band display when the user
00168     // transforms an entity. Note that the rubber-band is not displayed during
00169     // object creation
00170     virtual bool GetDisplaySnapRubberBand() const = 0;
00171     virtual void SetDisplaySnapRubberBand(bool bDisplayRubberBand) = 0;
00172 
00173     // Use Axis Constraint
00174     virtual void SetAxisConstraint(BOOL bUseAxisConstraint) = 0;
00175 
00176     // Read-Only access to the SnapInfo data. 
00177     // Returns false if it could not satisfy the request
00178     virtual bool GetSnapInfo(SnapInfo& si) const = 0;
00179 
00180     // Returns a pointer to the Osnap object that is current override snap object
00181     // The active snap type of the returned snap object is the exact snap override type.
00182     // NULL is returned when the snap system is not in override mode.
00183     virtual const Osnap* GetSnapOverride() const = 0;
00184 
00185     // for MXS exposure
00186     virtual void SetAFlag(int mask) = 0;
00187     virtual void ClearAFlag(int mask) = 0;
00188     virtual void setactive(boolean state) = 0;
00189     virtual void sethilite(Point3 col) = 0;
00190     virtual Point3 gethilite() = 0;
00191     virtual void setmarksize(int val) = 0;
00192     virtual int getmarksize() = 0;
00193     virtual BOOL SnapToFrozen() = 0;
00194     virtual void SetSnapToFrozen(BOOL state = TRUE) = 0;
00195     virtual Osnap* Enumerate(int FLAGS) const = 0;
00196     virtual DWORD GetSnapFlags() = 0;
00197 
00198     CoreExport static IOsnapManager7* GetInstance();
00199 };
00200 
00201