00001 /** 00002 * \file rvc/getobjf.h 00003 * \brief RVC::GETOBJFILTER class definitions 00004 * 00005 * \if NODOC 00006 * $Id: getobjf.h_v 1.5 2003/10/08 22:21:05 scowan Exp $ 00007 * 00008 * $Log: getobjf.h_v $ 00009 * Revision 1.5 2003/10/08 22:21:05 scowan 00010 * Doxygen adjustments. 00011 * 00012 * Revision 1.4 2003/09/30 16:52:06 dwilliss 00013 * Doxygen 00014 * 00015 * Revision 1.3 2003/09/25 21:56:37 dwilliss 00016 * doxygen 00017 * 00018 * Revision 1.2 2003/09/15 13:49:45 fileserver!dwilliss 00019 * Doxygen 00020 * 00021 * Revision 1.1 2002/09/09 20:05:37 mju 00022 * Initial revision 00023 * 00024 * \endif 00025 **/ 00026 00027 #ifndef INC_RVC_GETOBJF_H 00028 #define INC_RVC_GETOBJF_H 00029 00030 #ifndef INC_MI32_RVCDEFNS_H 00031 #include <mi32/rvcdefns.h> 00032 #endif 00033 00034 namespace RVC { 00035 00036 //=================================================================================================================== 00037 //! \class GETOBJFILTER rvc/getobjf.h 00038 //! \brief Base class for object selection filter. 00039 //! If a filter is provided to the DlgGetObject... function the IsSelectable() method 00040 //! will be called when the user attempts to select an object. In addition, for the 00041 //! DlgGetObjects() and DlgGetObjectSet() functions, the IsValidList() method will be 00042 //! called when the user presses the 'OK' button. This allows the list to be checked 00043 //! for self-consistency (for example, to make sure all rasters have equal dimensions). 00044 class GETOBJFILTER { 00045 public: 00046 00047 //! Default constructor. 00048 GETOBJFILTER ( 00049 ); 00050 00051 //! Clear current TEXTID and error value settings. 00052 void Clear ( 00053 ) { m_TextID = TEXTID__None; m_ErrValue = 0; } 00054 00055 //! Get current error value. 00056 ERRVALUE GetErrValue ( 00057 ) const { return (m_ErrValue); } 00058 00059 //! Get message based on the stored TEXTID and error value. 00060 //! If both and error value and a TEXTID are set the error value will take precedence. 00061 MISTRING GetMessage ( 00062 TEXTID TextID = TEXTID__None //!< Text ID to use for message if none previously set 00063 ) const; 00064 00065 //! Get current TEXTID setting. 00066 TEXTID GetTextID ( 00067 ) const { return (m_TextID); } 00068 00069 //! Determine if has selectable subobjects. 00070 //! Calls v_HasSelectableSubObjects which can be overridden. 00071 bool HasSelectableSubObjects ( 00072 const RVC::OBJITEM& objitem //!< Object to check 00073 ) { Clear(); return (v_HasSelectableSubObjects(objitem)); } 00074 00075 //! Determine if object is selectable. 00076 //! @return 'true' if selectable, 'false' if not. 00077 //! Calls v_IsSelectable() which can be overridden. 00078 bool IsSelectable ( 00079 const RVC::OBJITEM& objitem, //!< Object to check 00080 int position = -1 //!< Position of the object in the set for DlgGetObjectSet() functions. 00081 ) { Clear(); return (v_IsSelectable(objitem,position)); } 00082 00083 //! Determine if list of objects is valid and usable together. 00084 //! @return 'true' if list is valid, 'false' if not. 00085 //! Calls v_IsValidList which can be overridden. 00086 bool IsValidList ( 00087 const RVC::OBJITEMLIST& objlist //!< Object list to check 00088 ) { Clear(); return (v_IsValidList(objlist)); } 00089 00090 //! Set error value. 00091 void SetErrValue ( 00092 ERRVALUE err 00093 ) { m_ErrValue = err; } 00094 00095 //! Set the current TEXTID for this filter 00096 void SetTextID ( 00097 TEXTID TextID 00098 ) { m_TextID = TextID; } 00099 00100 private: 00101 #ifndef GENERATING_DOXYGEN_OUTPUT 00102 TEXTID m_TextID; 00103 ERRVALUE m_ErrValue; 00104 #endif // GENERATING_DOXYGEN_OUTPUT 00105 00106 //! Called by HasSelectableSubObjects() to determine if has selectable subobjects. 00107 //! Default implementation always returns 'false'. 00108 virtual bool v_HasSelectableSubObjects ( 00109 const RVC::OBJITEM& objitem //!< Object to check 00110 ); 00111 00112 //! Called by IsSelectable() to determine if object is selectable. 00113 //! @return 'true' if selectable, 'false' if not. 00114 //! Default implementation always returns 'true'. 00115 virtual bool v_IsSelectable ( 00116 const RVC::OBJITEM& objitem, //!< Object to check 00117 int position //!< Position of the object in the set for DlgGetObjectSet() functions. 00118 ); 00119 00120 //! Called by IsValidList() to determine if list of objects is valid and usable together. 00121 //! @return 'true' if list is valid, 'false' if not. 00122 //! Default implementation always returns 'true'. 00123 virtual bool v_IsValidList ( 00124 const RVC::OBJITEMLIST& objlist 00125 ); 00126 00127 }; 00128 00129 00130 //=================================================================================================================== 00131 00132 } //! End namespace RVC 00133 00134 #endif //!< INC_RVC_GETOBJF_H
1.3.8-20040913