00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM YYYY) 00022 **=======================================================================*/ 00023 00024 #ifndef _PB_BASE_ 00025 #define _PB_BASE_ 00026 00027 #include <Inventor/SbBasic.h> 00028 #include <MeshViz/PbBasic.h> 00029 00030 class PoBase; 00031 00049 class PbBase { 00050 00051 public: 00052 00058 void enableConnection(SbBool flag) 00059 { m_connectionEnabled = flag; } 00060 00064 SbBool isConnectionEnabled() const 00065 { return m_connectionEnabled; } 00066 00071 void touch(); 00072 00076 PbBase &operator=(const PbBase &base); 00077 00078 /*--------------------------------------------------------------------------*/ 00079 private: 00080 // Add or remove a PoBase object to the list of connected objects 00081 void addConnection(const PoBase *baseObj); 00082 SbBool removeConnection(const PoBase *baseObj); 00083 00084 // Change type for a PbBase Object 00085 enum ChangeType { 00086 TGS_TOUCH_TYPE, 00087 TGS_DELETE_TYPE, 00088 TGS_GEOMETRY_TYPE, 00089 TGS_SET_OF_VALUES_TYPE, 00090 TGS_SET_OF_STRINGS_TYPE, 00091 TGS_SET_OF_VECTORS_TYPE, 00092 TGS_DOMAIN_TRANSFORM_TYPE 00093 }; 00094 00095 // Get changement type 00096 ChangeType getChangeType() const { return m_changeType; } 00097 void getDataChange(int &data) const { data = m_intDataChange; } 00098 00099 private: 00100 // Constructors & destructors 00101 PbBase(); 00102 PbBase(const PbBase &base); 00103 virtual ~PbBase(); 00104 00105 // Empty the list of connected objects 00106 void removeAllConnection(); 00107 00108 // Set changement type and data for a PbBase Object 00109 void setChangeType(ChangeType type) { m_changeType = type; } 00110 void setDataChange(int data) { m_intDataChange = data; } 00111 00112 // Notify a change to all connected objects 00113 void notifyChange(); 00114 00115 private: 00116 struct Element { 00117 PoBase *baseObj; 00118 Element *next; 00119 }; 00120 00121 // Used by constructor per copy and affectation operator 00122 void copy(const PbBase &base, SbBool isConstructorPerCopy); 00123 00124 // Header of the list of PoBase object 00125 Element *m_headBaseObjList; 00126 00127 // Indicate if the connection is enabled or not 00128 SbBool m_connectionEnabled; 00129 00130 // Type of change 00131 ChangeType m_changeType; 00132 00133 // Integer data change 00134 int m_intDataChange; 00135 }; 00136 /*---------------------------------------------------------------------------*/ 00137 00138 #endif /* _PB_BASE_ */ 00139 00140