cgma
ToolData.hpp
Go to the documentation of this file.
00001 //- Class: ToolData
00002 //- Owner: Scott Mitchell
00003 //- Description: This is tool specific data that should chain off of CubitNode.
00004 //-              This is the generic form, all instances should be
00005 //-              more specific.
00006 //- Checked By: 
00007 //- Version: $Id: 
00008 
00009 #ifndef TOOL_DATA_HPP
00010 #define TOOL_DATA_HPP
00011 
00012 #include "CubitDefines.h"
00013 #include "CGMUtilConfigure.h"
00014 #include <cassert>
00015 
00016 class ToolDataUser;
00017 
00018 class CUBIT_UTIL_EXPORT ToolData
00019 {
00020   private:
00021 
00022     ToolData *nextToolData;
00023     //- next tool_data in the chain. Last one has this member NULL.
00024 
00025   protected:
00026 
00027     ToolData() {nextToolData = NULL;}
00028     //- protected constructor to eliminate creation by other than
00029     //- derived classes
00030 
00031   public:
00032 
00033     virtual ~ToolData();
00034     //- destructor
00035  
00036     ToolData* next_tool_data()               { return nextToolData; }
00037     void      next_tool_data(ToolData *data) { assert( data != this );
00038     nextToolData = data; }
00039     //- access to next tooldata in chain
00040   
00041     // handy for ToolDataUser::delete_TD, see e.g. DoubletPillower.cc
00042 
00043         
00044     virtual ToolData* propogate(ToolDataUser* new_td_user);
00045     //- propogate() receives the ToolData User that has been copied or split off from the 
00046     //- ToolDataUser this TD is on and returns the ToolData that should be put on the new 
00047     //- ToolDataUser.  If no new TD should be created, it returns NULL.
00048 
00049     virtual ToolData* merge(ToolDataUser* other_td_user);
00050     //- merge() receives a ToolDataUser that is about to be merged with the ToolDataUser that this
00051     //- TD is on.  It should process what should happen to this and any similar tooldata on the
00052     //- other ToolDataUser and return the TD that should be assigned to the merged entity.
00053     //- Note: ToolDataUser deletes any TD that is on it when itself is deleted.  The calling function
00054     //- should probably remove any TD returned by this function from the entities before deleting them.
00055   
00056 };
00057 // ********** BEGIN INLINE FUNCTIONS       **********
00058 
00059 // ********** END INLINE FUNCTIONS       **********
00060 
00061 
00062 #endif // TOOL_DATA_HPP
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines