[GME-commit]
GMESRC/GME/Gme GMEApp.cpp,1.123,1.124 GMEApp.h,1.24,1.25
ModelGrid.cpp,1.4,1.5
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Wed Aug 25 16:36:34 CDT 2004
Update of /var/lib/gme/GMESRC/GME/Gme
In directory braindrain:/tmp/cvs-serv9882/GME/Gme
Modified Files:
GMEApp.cpp GMEApp.h ModelGrid.cpp
Log Message:
Optional label avoidance for connections
CVS User: volgy
Index: GMEApp.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEApp.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -C2 -d -r1.123 -r1.124
*** GMEApp.cpp 24 Aug 2004 11:43:56 -0000 1.123
--- GMEApp.cpp 25 Aug 2004 20:36:31 -0000 1.124
***************
*** 113,116 ****
--- 113,117 ----
{
multipleView = false;
+ labelAvoidance = false;
// TODO: add construction code here,
set_terminate(EmergencyTerminate);
***************
*** 1215,1218 ****
--- 1216,1225 ----
CGMEEventLogger::StopLogging();
}
+
+
+ // Autorouter
+ VARIANT_BOOL labelavoidance;
+ COMTHROW( registrar->get_LabelAvoidance(REGACCESS_USER, &labelavoidance) );
+ labelAvoidance = (labelavoidance != VARIANT_FALSE);
}
MSGCATCH("Error while trying to get program settings",;);
Index: GMEApp.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEApp.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** GMEApp.h 1 Mar 2004 20:20:22 -0000 1.24
--- GMEApp.h 25 Aug 2004 20:36:31 -0000 1.25
***************
*** 56,59 ****
--- 56,60 ----
CString bitmapPath, projectDir, paradigmDir;
bool multipleView;
+ bool labelAvoidance;
HACCEL m_GMEView_hAccel;
Index: ModelGrid.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/ModelGrid.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ModelGrid.cpp 19 Jul 2004 17:19:29 -0000 1.4
--- ModelGrid.cpp 25 Aug 2004 20:36:31 -0000 1.5
***************
*** 1,4 ****
--- 1,5 ----
#include "stdafx.h"
+ #include "GMEApp.h"
#include "GMEStd.h"
#include "GuiObject.h"
***************
*** 192,199 ****
Set(s,pt,reset);
! loc = model->GetNameLocation();
! pt = loc.CenterPoint();
! s = loc.Size();
! Set(s,pt,reset);
}
--- 193,202 ----
Set(s,pt,reset);
! if (theApp.labelAvoidance) {
! loc = model->GetNameLocation();
! pt = loc.CenterPoint();
! s = loc.Size();
! Set(s,pt,reset);
! }
}
***************
*** 208,213 ****
bool avail = modelGrid.IsAvailable(rect.CenterPoint(), rect.Size());
! rect = model->GetNameLocation(aspIdx);
! avail = avail && modelGrid.IsAvailable(rect.CenterPoint(), rect.Size());
return avail;
--- 211,218 ----
bool avail = modelGrid.IsAvailable(rect.CenterPoint(), rect.Size());
! if (theApp.labelAvoidance) {
! rect = model->GetNameLocation(aspIdx);
! avail = avail && modelGrid.IsAvailable(rect.CenterPoint(), rect.Size());
! }
return avail;
***************
*** 216,223 ****
bool CModelGrid::GetClosestAvailable(CGuiObject *model,CPoint &pt)
{
- CRect loc = model->GetLocation();
- CRect nameLoc = model->GetNameLocation();
CRect unionLoc;
! unionLoc.UnionRect(&loc, &nameLoc);
CSize offset = unionLoc.CenterPoint() - loc.CenterPoint();
--- 221,233 ----
bool CModelGrid::GetClosestAvailable(CGuiObject *model,CPoint &pt)
{
CRect unionLoc;
! CRect loc = model->GetLocation();
! if (theApp.labelAvoidance) {
! CRect nameLoc = model->GetNameLocation();
! unionLoc.UnionRect(&loc, &nameLoc);
! }
! else {
! unionLoc = loc;
! }
CSize offset = unionLoc.CenterPoint() - loc.CenterPoint();
***************
*** 247,256 ****
bool can = IsAvailable(r.CenterPoint(),r.Size());
! r = model->GetNameLocation();
! r.right += right;
! r.left += right;
! r.top += down;
! r.bottom += down;
! can = can && IsAvailable(r.CenterPoint(),r.Size());
return can;
--- 257,268 ----
bool can = IsAvailable(r.CenterPoint(),r.Size());
! if (theApp.labelAvoidance) {
! r = model->GetNameLocation();
! r.right += right;
! r.left += right;
! r.top += down;
! r.bottom += down;
! can = can && IsAvailable(r.CenterPoint(),r.Size());
! }
return can;
More information about the GME-commit
mailing list