Definition at line 63 of file LabeledGraph.h. References OglGui::OglWindow::GetDimensions(), OglGui::OglWindow::H(), M_PI, OglGui::Graph::mNodes, and OglGui::OglWindow::W(). Referenced by doLayout(). 00063 { 00064 int x, y, w, h; 00065 mNodes[0].nodeVector[0]->GetDimensions(x, y, w, h); 00066 uint cx = (W()-w)/2, cy = (H()-h)/2; 00067 mNodes[0].nodeVector[0]->SetDimensions(cx, cy, w, h); 00068 uint count = mNodes[0].nodeVector.size()-1; 00069 float count_2_pi = count/(M_PI*2); 00070 float rx = 1.0-0.5*w/W(), ry = 1.0-0.5*h/H(); 00071 for(float i=1; i <= count; i++) { 00072 mNodes[0].nodeVector[i]->GetDimensions(x, y, w, h); 00073 x = cx * (1 + rx*sin(i/count_2_pi)); 00074 y = cy * (1 + ry*cos(i/count_2_pi)); 00075 mNodes[0].nodeVector[i]->SetDimensions(x, y, w, h); 00076 } 00077 return true; 00078 }
Here is the call graph for this function:
|