cgma
|
00001 //- Class: CubitEntity 00002 //- Description: CubitEntity class - the base class in the CUBIT Entity Tree. 00003 //- Owner: Bill Bohnhoff 00004 //- Checked by: Tim Tautges, 6/6/94 00005 //- Version: $Id: 00006 00007 #ifndef CUBITENTITY_HPP 00008 #define CUBITENTITY_HPP 00009 00010 #include "CubitDefines.h" 00011 #include "InvalidEntity.hpp" 00012 00013 #include <typeinfo> 00014 00015 class CubitBox; 00016 class CubitVector; 00017 class CubitString; 00018 #include "CGMUtilConfigure.h" 00019 #include "DLIList.hpp" 00020 00021 class CUBIT_UTIL_EXPORT CubitEntity 00022 { 00023 public: 00024 00025 //- Heading: Constructors and Destructor 00026 CubitEntity() : entityId(0) {} 00027 00028 virtual ~CubitEntity() ; 00029 00030 //- Heading: Set and Inquire functions 00031 virtual int id() const; 00032 00033 virtual void set_id(int i); 00034 //- set the id of this entity to i 00035 00036 //- Heading: Virtual functions 00037 //virtual void list() const = 0; //- pure virtual 00038 00039 virtual CubitBox bounding_box() = 0; 00040 virtual CubitVector center_point(); 00041 00042 //@ The overloaded members color() and is_visible() are 00043 //@ not pure virtual because mesh entities will NOT override these. 00044 //@ Mesh entities rely on the RefEntity owner for this information. 00045 virtual void color(int value); 00046 virtual int color() const; 00047 00048 virtual void is_visible(int flag); 00049 virtual int is_visible() const; 00050 virtual void is_transparent(int flag); 00051 virtual int is_transparent() const; 00052 00053 virtual const std::type_info& entity_type_info() const = 0; 00054 00055 virtual const char* class_name() const = 0; 00056 //- return class name string. 00057 00058 virtual CubitString entity_name() const = 0; 00059 //- return the name of this entity. If one not assigned, a default one will be generated. 00060 00061 protected: 00062 int entityId; 00063 00064 00065 private: 00066 CubitEntity( const CubitEntity& ); 00067 void operator=( const CubitEntity&); 00068 }; 00069 00070 //template <> struct DLIListSorter<CubitEntity*> 00071 //{ 00072 // bool operator()(CubitEntity* a, CubitEntity* b) { return a->id() < b->id(); } 00073 //}; 00074 00075 #endif 00076