Public Member Functions | |
NetPoint () | |
void | setNotFree () |
void | mark_as_tx () |
void | move (bool goto_shouldbe) |
void | fixx () |
void | fixy () |
void | realize () |
void | set_bound (int mx, int my) |
Public Attributes | |
double | x |
double | y |
double | shouldbe_x |
double | shouldbe_y |
double | a |
double | b |
double | nx |
double | ny |
bool | free |
NetPoint * | up |
NetPoint * | down |
NetPoint * | left |
NetPoint * | right |
Definition at line 27 of file morph.cpp.
|
Definition at line 42 of file morph.cpp. References down, free, left, right, shouldbe_x, shouldbe_y, up, x, and y. 00043 { 00044 x = y = shouldbe_x = shouldbe_y = 0; 00045 free = true; 00046 up = down = left = right = NULL; 00047 }
|
|
Definition at line 112 of file morph.cpp. References a, free, left, right, and x. 00113 { 00114 if (!free) return; 00115 // where are the current endpoints 00116 NetPoint * L; 00117 L = left; 00118 while(L) 00119 { 00120 if (!L->free) break; 00121 L=L->left; 00122 } 00123 00124 NetPoint * R; 00125 R = right; 00126 while(R) 00127 { 00128 if (!R->free) break; 00129 R=R->right; 00130 } 00131 assert(L&&R); 00132 double pct = (a-L->a)/(R->a-L->a); 00133 printf("%g\n",pct); 00134 x = pct*(R->x-L->x)+L->x; 00135 }
|
|
Definition at line 137 of file morph.cpp. References b, down, free, up, and y. 00138 { 00139 if (!free) return; 00140 // where are the current endpoints 00141 NetPoint * U; 00142 U = up; 00143 while(U) 00144 { 00145 if (!U->free) break; 00146 U=U->up; 00147 } 00148 00149 NetPoint * D; 00150 D = down; 00151 while(D) 00152 { 00153 if (!D->free) break; 00154 D=D->down; 00155 } 00156 assert(U&&D); 00157 double pct = (b-U->b)/(D->b-U->b); 00158 y = pct*(D->y-U->y)+U->y; 00159 }
|
|
Definition at line 54 of file morph.cpp. References a, b, shouldbe_x, shouldbe_y, x, and y. 00055 { 00056 a = x; 00057 b = y; 00058 x = shouldbe_x; 00059 y = shouldbe_y; 00060 }
|
|
Definition at line 61 of file morph.cpp. References down, free, left, nx, ny, right, shouldbe_x, shouldbe_y, sign(), up, x, and y. 00062 { 00063 double bx = x; 00064 double by = y; 00065 if (free) 00066 { 00067 int i = 0; 00068 x = 0; 00069 y = 0; 00070 if (left) 00071 { 00072 x+=left->x; 00073 y+=left->y; 00074 i++; 00075 } 00076 if (right) 00077 { 00078 x+=right->x; 00079 y+=right->y; 00080 i++; 00081 } 00082 if (up) 00083 { 00084 x+=up->x; 00085 y+=up->y; 00086 i++; 00087 } 00088 if (down) 00089 { 00090 x+=down->x; 00091 y+=down->y; 00092 i++; 00093 } 00094 x/=i; 00095 y/=i; 00096 } 00097 else if (goto_shouldbe && (shouldbe_x != x || shouldbe_y != y)) 00098 { 00099 double dx=0; 00100 double dy=0; 00101 dx = sign(shouldbe_x-x); 00102 dy = sign(shouldbe_y-y); 00103 x+=dx; 00104 y+=dy; 00105 } 00106 nx = x; 00107 ny =y; 00108 x = bx; 00109 y = by; 00110 }
|
|
Definition at line 161 of file morph.cpp.
|
|
Definition at line 167 of file morph.cpp. 00168 { 00169 if (x>mx-1) x = mx-1; 00170 if (y>my-1) y = my-1; 00171 if (a>mx-1) a = mx-1; 00172 if (b>my-1) b = my-1; 00173 if (x<0) x = 0; 00174 if (y<0) y = 0; 00175 if (a<0) a = 0; 00176 if (b<0) b = 0; 00177 }
|
|
Definition at line 48 of file morph.cpp. References free, shouldbe_x, shouldbe_y, x, and y. 00049 { 00050 shouldbe_x=x; 00051 shouldbe_y=y; 00052 free = false; 00053 }
|
|
Definition at line 33 of file morph.cpp. Referenced by fixx(), mark_as_tx(), and set_bound(). |
|
Definition at line 34 of file morph.cpp. Referenced by fixy(), mark_as_tx(), and set_bound(). |
|
Definition at line 39 of file morph.cpp. Referenced by fixy(), move(), and NetPoint(). |
|
Definition at line 37 of file morph.cpp. Referenced by fixx(), fixy(), move(), NetPoint(), and setNotFree(). |
|
Definition at line 40 of file morph.cpp. Referenced by fixx(), move(), and NetPoint(). |
|
|
|
|
|
Definition at line 41 of file morph.cpp. Referenced by fixx(), move(), and NetPoint(). |
|
Definition at line 31 of file morph.cpp. Referenced by mark_as_tx(), move(), NetPoint(), and setNotFree(). |
|
Definition at line 32 of file morph.cpp. Referenced by mark_as_tx(), move(), NetPoint(), and setNotFree(). |
|
Definition at line 38 of file morph.cpp. Referenced by fixy(), move(), and NetPoint(). |
|
Definition at line 29 of file morph.cpp. Referenced by fixx(), mark_as_tx(), move(), NetPoint(), realize(), set_bound(), and setNotFree(). |
|
Definition at line 30 of file morph.cpp. Referenced by fixy(), mark_as_tx(), move(), NetPoint(), realize(), set_bound(), and setNotFree(). |