[GME-commit] GMESRC/GME/ObjectInspector Attribute.cpp,1.15,1.16 Attribute.h,1.5,1.6

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Fri Sep 3 15:43:50 CDT 2004


Update of /var/lib/gme/GMESRC/GME/ObjectInspector
In directory braindrain:/tmp/cvs-serv28380

Modified Files:
	Attribute.cpp Attribute.h 
Log Message:
Hiding model attributes reintroduced based on the "isShown" attribute.


CVS User: zolmol

Index: Attribute.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ObjectInspector/Attribute.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Attribute.cpp	20 Jul 2004 10:48:34 -0000	1.15
--- Attribute.cpp	3 Sep 2004 19:43:47 -0000	1.16
***************
*** 85,89 ****
  		
  			
! 		bool bIsCommonAttr=true;
  		bool bIsDirty=false; //is attribute values different for attributes of same type?
  		
--- 85,89 ----
  		
  			
! 		bool bIsCommonAttr = isViewable( ccpFirstFCO, ccpMetaAttribute);
  		bool bIsDirty=false; //is attribute values different for attributes of same type?
  		
***************
*** 96,100 ****
  		COMTHROW(MGACOLL_ITER->get_Status(&lStatus));
  		bool bIsDefault=(lStatus==-1?true:false);
! 		
  		while(posIterate)
  		{
--- 96,100 ----
  		COMTHROW(MGACOLL_ITER->get_Status(&lStatus));
  		bool bIsDefault=(lStatus==-1?true:false);
! 
  		while(posIterate)
  		{
***************
*** 115,119 ****
  				COMTHROW(hrRes);
  			}
! 			
  
  			COMTHROW(ccpCurrAttribute->get_Status(&lStatus));
--- 115,123 ----
  				COMTHROW(hrRes);
  			}
! 
! 			if( !(bIsCommonAttr = isViewable( ccpCurrFCO, ccpMetaAttribute)))
! 			{
! 				break;
! 			}
  
  			COMTHROW(ccpCurrAttribute->get_Status(&lStatus));
***************
*** 225,228 ****
--- 229,277 ----
  
  
+ }
+ 
+ //
+ // We decide if a model attribute is shown based on the model's first aspect
+ // (currently for all aspects the same attribute list is used)
+ bool CAttribute::isViewable( const CComPtr<IMgaFCO>& fco, const CComPtr<IMgaMetaAttribute>& attr_meta) const
+ {
+ 	bool res = true;
+ 	objtype_enum objtype;
+ 	COMTHROW( fco->get_ObjType( &objtype) );
+ 	if( objtype == OBJTYPE_MODEL)
+ 	{
+ 		res = false;
+ 		CComPtr<IMgaMetaFCO> meta;
+ 		CComPtr<IMgaMetaModel> model_meta;
+ 		CComPtr<IMgaMetaAspects> asps;
+ 		CComPtr<IMgaMetaAttributes> shown_attrs;
+ 		metaref_type req_metaid;
+ 
+ 		COMTHROW( fco->get_Meta( &meta));
+ 		COMTHROW( meta.QueryInterface( &model_meta));
+ 		COMTHROW( model_meta->get_Aspects( &asps ));
+ 		COMTHROW( attr_meta->get_MetaRef( &req_metaid));
+ 		
+ 		MGACOLL_ITERATE(IMgaMetaAspect, asps) {
+ 			COMTHROW( MGACOLL_ITER->get_Attributes( &shown_attrs));
+ 			break;
+ 		}
+ 		MGACOLL_ITERATE_END;
+ 
+ 
+ 		MGACOLL_ITERATE(IMgaMetaAttribute, shown_attrs) {
+ 			metaref_type metaid;
+ 			COMTHROW(MGACOLL_ITER->get_MetaRef(&metaid));
+ 
+ 			if( metaid == req_metaid)
+ 			{
+ 				res = true;
+ 				break;
+ 			}
+ 			
+ 		}
+ 		MGACOLL_ITERATE_END;
+ 	}
+ 	return res;
  }
  

Index: Attribute.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ObjectInspector/Attribute.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Attribute.h	19 Jul 2004 15:22:59 -0000	1.5
--- Attribute.h	3 Sep 2004 19:43:47 -0000	1.6
***************
*** 28,31 ****
--- 28,32 ----
  private:
  	bool CreateListItem(CListItem& ListItem, const CComVariant& ccvtValue, bool bIsDirty, bool bIsDefault, DWORD dwKey);
+ 	bool isViewable( const CComPtr<IMgaFCO>& r, const CComPtr<IMgaMetaAttribute>& a) const;
  };
  



More information about the GME-commit mailing list