RealWorldMapUtils.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003     FILE: RealWorldMapUtils.h
00004 
00005     DESCRIPTION:  Utilities for supporting real-world maps size parameters
00006 
00007     CREATED BY: Scott Morrison
00008 
00009     HISTORY: created Feb. 1, 2005
00010 
00011  *> Copyright (c) 2005, All Rights Reserved.
00012  **********************************************************************/
00013 #pragma once
00014 
00015 #include "coreexp.h"
00016 #include <WTypes.h>
00017 #include "ifnpub.h"
00018 // forward declarations
00019 class Animatable;
00020 
00026 template <class T> class RealWorldScaleRecord: public RestoreObj
00027 {
00028 public:     
00029 
00033     RealWorldScaleRecord(T* pObj, BOOL oldState)
00034     {
00035         mpObj = pObj;
00036         mOldState = oldState;
00037     }
00038 
00044     void Restore(int isUndo)
00045     {
00046         if (isUndo)
00047             mpObj->SetUsePhysicalScaleUVs(mOldState);
00048     }  
00049 
00054     void Redo()
00055     {
00056         mpObj->SetUsePhysicalScaleUVs(!mOldState);
00057     }
00058 
00059 private:
00060     T* mpObj;
00061     BOOL mOldState;
00062 };
00063 
00065 #define RWS_INTERFACE Interface_ID(0x9ff44ef, 0x6c050704)
00066 
00068 extern CoreExport FPInterfaceDesc gRealWorldMapSizeDesc;
00069 
00088 
00089 class RealWorldMapSizeInterface: public FPMixinInterface
00090 {
00091 public:
00094     virtual BOOL GetUsePhysicalScaleUVs() = 0;
00097     virtual void SetUsePhysicalScaleUVs(BOOL flag) = 0;
00098     
00099     //From FPMixinInterface
00104     FPInterfaceDesc* GetDesc() { return &gRealWorldMapSizeDesc; }
00105     
00106     
00108     enum{ rws_getRealWorldMapSize, rws_setRealWorldMapSize};
00109     
00110     // Function Map for Function Publishing System 
00111     //***********************************
00112     BEGIN_FUNCTION_MAP
00113     PROP_FNS    (rws_getRealWorldMapSize, GetUsePhysicalScaleUVs, rws_setRealWorldMapSize, SetUsePhysicalScaleUVs, TYPE_BOOL    ); 
00114     END_FUNCTION_MAP
00115     
00116     
00117 };
00118 
00120 
00121 
00122 
00123 
00124 CoreExport BOOL GetUsePhysicalScaleUVs(Animatable* pAnim);
00127 CoreExport void SetUsePhysicalScaleUVs(Animatable* pAnim, BOOL flag);
00129 
00131 
00132 
00133 
00134 CoreExport BOOL GetPhysicalScaleUVsDisabled();
00137 CoreExport void SetPhysicalScaleUVsDisabled(BOOL disable);