cgma
|
00001 //- Class: ToolDataUser 00002 //- Owner: Scott Mitchell 00003 //- Description: This is the tool data interface that every class that uses a 00004 //- tool data needs to specify. E.g. CubitNode and CubitFace 00005 //- are derived from this class. 00006 //- Checked By: 00007 //- Version: $Id: 00008 00009 #ifndef TOOL_DATA_USER_HPP 00010 #define TOOL_DATA_USER_HPP 00011 00012 #include "CubitDefines.h" 00013 #include "CGMUtilConfigure.h" 00014 00015 class ToolData; 00016 00017 typedef int (*IdentityFn)(const ToolData* td); 00018 template <class X> class DLIList; 00019 00020 class CUBIT_UTIL_EXPORT ToolDataUser 00021 { 00022 00023 private: 00024 ToolDataUser( const ToolDataUser& ); 00025 void operator=( const ToolDataUser&); 00026 00027 ToolData *toolData; 00028 //- generic pointer to extra data needed by a particular VolSmoothTool. 00029 //- see the _TD functions below for how to access this 00030 00031 void tool_data(ToolData *set_data) {toolData = set_data;} 00032 ToolData* tool_data() const {return toolData;} 00033 //- all external access/setting should be done with the _TD functions. 00034 00035 public: 00036 00037 ToolDataUser () { toolData = NULL; } 00038 00039 virtual ~ToolDataUser(); 00040 //- automatically deletes all the chained ToolDatas 00041 00042 virtual CubitBoolean delete_TD(IdentityFn specified_type); 00043 //- delete the specific type of tool data from the chain. 00044 //- return true if something was actually found and deleted. 00045 00046 virtual CubitBoolean delete_TD(ToolData *td); 00047 //- delete the specific tool data from the chain. 00048 //- return true if something was actually found and deleted. 00049 00050 virtual ToolData *remove_TD(IdentityFn specified_type); 00051 //- remove the specific type of tool data from the chain, and 00052 //- return it. 00053 00054 virtual ToolData *remove_TD(ToolData *td); 00055 //- remove the specific tool data from the chain, and 00056 //- return it. 00057 00058 virtual void add_TD(ToolData *new_td); 00059 //- add the new_td to the beginning of the tool_data chain 00060 00061 virtual ToolData *get_TD(IdentityFn specified_type); 00062 virtual ToolData const *get_TD(IdentityFn specified_type) const; 00063 virtual void get_all_TDs(IdentityFn specified_type, 00064 DLIList <ToolData *> *all_tds) const; 00065 00066 virtual void get_all_TDs(DLIList <ToolData *> *all_tds) const; 00067 //- get the specific type of ToolData in the chain. 00068 //- returns null if not found. 00069 00070 }; 00071 00072 00073 #endif // TOOL_DATA_USER_HPP 00074 00075 00076 00077 00078