[GME-commit]
GMESRC/GME/MgaUtil MakeClosure.cpp,1.3,1.4 MakeClosure.h,1.1,1.2
MgaClosure.cpp,1.2,1.3
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Fri Jul 23 14:56:54 CDT 2004
Update of /var/lib/gme/GMESRC/GME/MgaUtil
In directory braindrain:/tmp/cvs-serv12042
Modified Files:
MakeClosure.cpp MakeClosure.h MgaClosure.cpp
Log Message:
Closure bug corrected (in case library handling == stop, connections to library elements are not dumped anymore)
CVS User: zolmol
Index: MakeClosure.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/MgaUtil/MakeClosure.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MakeClosure.cpp 14 Jul 2004 19:30:15 -0000 1.3
--- MakeClosure.cpp 23 Jul 2004 18:56:51 -0000 1.4
***************
*** 359,363 ****
{
bool inlib = isInLibrary( fco); // a referred fco may be in a library
! if ( inlib && m_bIntoLibraries || !inlib)
insertNew( fco);
}
--- 359,363 ----
{
bool inlib = isInLibrary( fco); // a referred fco may be in a library
! if ( inlib && m_iIntoLibraries == LIB_CONT || !inlib)
insertNew( fco);
}
***************
*** 384,396 ****
}
void CMakeClosure::procConnection( IMgaConnection *connection)
{
ASSERT( connection != NULL );
- insertNew( CComObjPtr<IMgaFCO>( connection));
! if ( m_bConnection)
{
CComObjPtrVector<IMgaConnPoint> v;
COMTHROW( connection->get_ConnPoints( PutOut( v)) );
for( CComObjPtrVector<IMgaConnPoint>::iterator i = v.begin(); i != v.end(); ++i)
{
--- 384,420 ----
}
+ bool CMakeClosure::isValidConnection( IMgaConnection * connection)
+ {
+ bool res = true;
+
+ if( m_iIntoLibraries == LIB_STOP)
+ {
+ CComObjPtrVector<IMgaConnPoint> v;
+ COMTHROW( connection->get_ConnPoints( PutOut( v)) );
+
+ for( CComObjPtrVector<IMgaConnPoint>::iterator i = v.begin(); res && i != v.end(); ++i)
+ {
+ CComObjPtr<IMgaConnPoint> connpoint = *i;
+
+ CComObjPtr<IMgaFCO> target; // the src or dst of a connection
+ COMTHROW( connpoint->get_Target( PutOut( target)) );
+ if( target && isInLibrary( target))
+ res = false; // this is a connection with one end in a library which in lib_stop case is not good
+ }
+ }
+
+ return res;
+ }
+
void CMakeClosure::procConnection( IMgaConnection *connection)
{
ASSERT( connection != NULL );
! if ( m_bConnection && isValidConnection( connection))
{
CComObjPtrVector<IMgaConnPoint> v;
COMTHROW( connection->get_ConnPoints( PutOut( v)) );
+
+ insertNew( CComObjPtr<IMgaFCO>( connection));
for( CComObjPtrVector<IMgaConnPoint>::iterator i = v.begin(); i != v.end(); ++i)
{
***************
*** 415,434 ****
COMTHROW( connpoint->get_References( PutOut( refs)) );
! if ( refs.empty()) // simple connection, no reference ports involved
! {
! insertNew( target);
! insertNew( conn_fco);
! }
! else if ( m_bReferredBy) // because the internal representation of the connections through refports
{
! bool inlib;
! inlib = isInLibrary( target);
! if ( inlib && m_bIntoLibraries || !inlib) insertNew( target);
!
! inlib = isInLibrary( conn_fco); // the connection might be in the library (=both endtargets are as well in the library)
! if ( inlib && m_bIntoLibraries || !inlib)
{
! insertNew( conn_fco);
! insertNew( refs);
}
}
--- 439,461 ----
COMTHROW( connpoint->get_References( PutOut( refs)) );
! if( isValidConnection( conn))
{
! if ( refs.empty()) // simple connection, no reference ports involved
{
! insertNew( target);
! insertNew( conn_fco);
! }
! else if ( m_bReferredBy) // because the internal representation of the connections through refports
! {
! bool inlib;
! inlib = isInLibrary( target);
! if ( inlib && m_iIntoLibraries == LIB_CONT || !inlib) insertNew( target);
!
! inlib = isInLibrary( conn_fco); // the connection might be in the library (=both endtargets are as well in the library)
! if ( inlib && m_iIntoLibraries == LIB_CONT || !inlib)
! {
! insertNew( conn_fco);
! insertNew( refs);
! }
}
}
***************
*** 445,449 ****
for( CComObjPtrVector<IMgaConnPoint>::iterator i = my_conns.begin(); i != my_conns.end(); ++i)
{
! procConnPoint( *i);
}
}
--- 472,476 ----
for( CComObjPtrVector<IMgaConnPoint>::iterator i = my_conns.begin(); i != my_conns.end(); ++i)
{
! procConnPoint( *i);//the validity of each connection is tested
}
}
***************
*** 513,518 ****
{
ASSERT( obj != NULL );
!
! if ( !m_bIntoLibraries && isInLibrary( obj)) // if no intention to step into libraries and the object is in a library then return
return;
--- 540,545 ----
{
ASSERT( obj != NULL );
! //!m_bIntoLibraries <=> m_iIntoLibraries != 2
! if ( m_iIntoLibraries != LIB_CONT && isInLibrary( obj)) // if no intention to step into libraries and the object is in a library then return
return;
***************
*** 637,641 ****
{
bool inlib = isInLibrary( base); // base types may be in a library
! if ( inlib && m_bIntoLibraries || !inlib)
insertNew( base);
}
--- 664,668 ----
{
bool inlib = isInLibrary( base); // base types may be in a library
! if ( inlib && m_iIntoLibraries == LIB_CONT || !inlib)
insertNew( base);
}
Index: MakeClosure.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/MgaUtil/MakeClosure.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MakeClosure.h 2 Jun 2004 21:30:44 -0000 1.1
--- MakeClosure.h 23 Jul 2004 18:56:51 -0000 1.2
***************
*** 24,27 ****
--- 24,30 ----
};
+ #define LIB_STUBS 0
+ #define LIB_STOP 1
+ #define LIB_CONT 2
class CMakeClosure
***************
*** 36,40 ****
int fold_cont = 1, int part_of_fold = 1,
int base_type = 1, int derived_type = 1,
! int into_libr = 1,
int container_opt = 0,
int direction_opt = 1
--- 39,43 ----
int fold_cont = 1, int part_of_fold = 1,
int base_type = 1, int derived_type = 1,
! int into_libr = LIB_STUBS,
int container_opt = 0,
int direction_opt = 1
***************
*** 51,55 ****
, m_bBaseTypes( base_type == 1)
, m_bDerivedTypes( derived_type == 1)
! , m_bIntoLibraries( into_libr == 1)
, m_iContainerOption( container_opt)
, m_bDirection( direction_opt == 1)
--- 54,58 ----
, m_bBaseTypes( base_type == 1)
, m_bDerivedTypes( derived_type == 1)
! , m_iIntoLibraries( into_libr)
, m_iContainerOption( container_opt)
, m_bDirection( direction_opt == 1)
***************
*** 122,125 ****
--- 125,129 ----
void procMyDerivedTypes ( IMgaFCO * fco);
+ bool isValidConnection( IMgaConnection * connection);
bool isInLibrary( IMgaObject * obj);
***************
*** 189,193 ****
bool m_bDerivedTypes; // derived types of selected objects
! bool m_bIntoLibraries; // process through links that point into a library?
int m_iContainerOption; // wrap?
--- 193,197 ----
bool m_bDerivedTypes; // derived types of selected objects
! int m_iIntoLibraries; // 0 stubs, 1 stop, 2 continue process through links that point into a library?
int m_iContainerOption; // wrap?
Index: MgaClosure.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/MgaUtil/MgaClosure.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MgaClosure.cpp 30 Jun 2004 17:50:47 -0000 1.2
--- MgaClosure.cpp 23 Jul 2004 18:56:51 -0000 1.3
***************
*** 31,35 ****
dlg.m_bBaseTypes, dlg.m_bDerivedTypes,
//dlg.m_bDigIntoLibraries,
! dlg.m_libraryHandling == 2, // in case of "continue" ("go on") only
dlg.m_wrappingOption,
dlg.m_direction);
--- 31,35 ----
dlg.m_bBaseTypes, dlg.m_bDerivedTypes,
//dlg.m_bDigIntoLibraries,
! dlg.m_libraryHandling /*== 2*/, // in case of "continue" ("go on") only
dlg.m_wrappingOption,
dlg.m_direction);
More information about the GME-commit
mailing list