[GME-commit]
GMESRC/GME/MgaUtil MakeClosure.cpp,1.4,1.5 MakeClosure.h,1.2,1.3
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Mon Aug 2 18:51:28 CDT 2004
Update of /var/lib/gme/GMESRC/GME/MgaUtil
In directory braindrain:/tmp/cvs-serv9817
Modified Files:
MakeClosure.cpp MakeClosure.h
Log Message:
Closure logic checks for the validity of the initially selected objects.
CVS User: zolmol
Index: MakeClosure.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/MgaUtil/MakeClosure.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MakeClosure.cpp 23 Jul 2004 18:56:51 -0000 1.4
--- MakeClosure.cpp 2 Aug 2004 22:51:25 -0000 1.5
***************
*** 164,168 ****
initTrans();
! doClosure();
doneTrans( false);
--- 164,168 ----
initTrans();
! if( isValidSelection()) doClosure();
doneTrans( false);
***************
*** 384,387 ****
--- 384,417 ----
}
+
+ bool CMakeClosure::isValidSelection()
+ {
+ // check each object for validity
+ CComObjPtrVector<IMgaFCO>::iterator fco_it = m_selFcos.begin();
+ while( fco_it != m_selFcos.end())
+ {
+ if( !isValidFCO( *fco_it))
+ fco_it = m_selFcos.erase( fco_it);
+ else
+ ++fco_it;
+ }
+
+ return m_selFcos.size() + m_selFolds.size() > 0;
+ }
+
+ bool CMakeClosure::isValidFCO( IMgaFCO * fco)
+ {
+ objtype_enum objtype;
+ COMTHROW( fco->get_ObjType( &objtype) );
+ if( objtype == OBJTYPE_CONNECTION)
+ {
+ CComObjPtr<IMgaConnection> c;
+ COMTHROW( ::QueryInterface( fco, c) );
+ return isValidConnection( c);
+ }
+
+ return true;
+ }
+
bool CMakeClosure::isValidConnection( IMgaConnection * connection)
{
***************
*** 1327,1330 ****
--- 1357,1361 ----
+ // put the objects into the new territory
CComObjPtrVector<IMgaFCO>::iterator fco_it = m_selFcos.begin();
for( ; fco_it != m_selFcos.end(); ++fco_it )
***************
*** 1336,1339 ****
--- 1367,1371 ----
*fco_it = fco;
}
+
CComObjPtrVector<IMgaFolder>::iterator fold_it = m_selFolds.begin();
for( ; fold_it != m_selFolds.end(); ++fold_it )
Index: MakeClosure.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/MgaUtil/MakeClosure.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MakeClosure.h 23 Jul 2004 18:56:51 -0000 1.2
--- MakeClosure.h 2 Aug 2004 22:51:25 -0000 1.3
***************
*** 125,128 ****
--- 125,130 ----
void procMyDerivedTypes ( IMgaFCO * fco);
+ bool isValidSelection();
+ bool isValidFCO( IMgaFCO *fco);
bool isValidConnection( IMgaConnection * connection);
bool isInLibrary( IMgaObject * obj);
More information about the GME-commit
mailing list