[GME-commit]
GMESRC/Paradigms/MetaGME/BonExtension/Gui SelConf.cpp,1.3,1.4
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Wed Mar 17 14:39:10 CST 2004
Update of /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Gui
In directory braindrain:/tmp/cvs-serv19800/Gui
Modified Files:
SelConf.cpp
Log Message:
Modified dialog yes/no automatisms in order to prevent non-abstract extension of FCO.
Modified Files:
Gui/SelConf.cpp Rep/FCO.cpp Rep/FCO.h
CVS User: zolmol
Index: SelConf.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Gui/SelConf.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SelConf.cpp 10 Mar 2004 02:50:18 -0000 1.3
--- SelConf.cpp 17 Mar 2004 20:39:07 -0000 1.4
***************
*** 260,263 ****
--- 260,264 ----
+ // which: true if the user selected NO, false if the user selected YES
void SelConf::getDescsAncs( bool which, int changed, std::vector< int > & res)
{
***************
*** 278,301 ****
if( fco_ptr)
{
! std::vector<FCO *> desc;
! if ( which)
! desc = fco_ptr->getAllDescendants();
! else
! desc = fco_ptr->getAllAncestors();
! for( unsigned int i = 0; i < desc.size(); ++i)
{
! FCO * desc_ptr = desc[i];
POSITION pos_d = m_entries.GetHeadPosition();
entry *e_d = 0;
while (pos_d) {
e_d = m_entries.GetNext(pos_d);
! if ( e_d->ptr == desc_ptr)
{
! res.push_back( e_d->id);
break;
}
}
-
}
}
--- 279,309 ----
if( fco_ptr)
{
! std::vector<FCO *> family;
! if ( which) // means 'no' is selected
! {
! if ( fco_ptr->getMyKind() == Any::FCO_REP || !fco_ptr->hasParentOfSameKind()) //if fco_rep is selected for 'no' means no other elements in the hierarchy needed to be extended or if has _not_ the same kind of ancestor means doesn't inherit from a same kind object (inherits from FCO)
! fco_ptr->getAllInMyHierarchy( family);
! else
! family = fco_ptr->getAllDescendants();
! }
! else // means 'yes'
! {
! family = fco_ptr->getAllAncestors(); // since fco_rep may exist among the ancestors and that will become yes, we have to make yes all fcoreps and the first nonfcorep leaves
! fco_ptr->getRootDescsUntilNonFcoRep( family); // get more dependants
! }
! for( unsigned int i = 0; i < family.size(); ++i)
{
! FCO * dep_ptr = family[i]; // dependant
POSITION pos_d = m_entries.GetHeadPosition();
entry *e_d = 0;
while (pos_d) {
e_d = m_entries.GetNext(pos_d);
! if ( e_d->ptr == dep_ptr)
{
! res.push_back( e_d->id);
break;
}
}
}
}
More information about the GME-commit
mailing list