Changeset 2544 in Sophya for trunk/SophyaPI/PI/pi3dwdg.cc
- Timestamp:
- Jun 1, 2004, 5:49:36 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pi3dwdg.cc
r2539 r2544 82 82 AddDrawer3D(mBDrw, false, true); 83 83 mBDrw->SetAxesFlags(kStdAxes); 84 Set3DViewBox(0., 1., 0., 1., 0., 1., false, false); 84 85 vfixed = false; // Il faut laisser le premier Drawer3D fixer les limites et la vue 3D 86 fixed3DBox = false; 85 87 86 88 mPx = mPy = 0; … … 150 152 } 151 153 154 /* --Methode-- */ 155 void PIDraw3DWdg::Set3DViewBox(double xmin, double xmax, double ymin, double ymax, 156 double zmin, double zmax, bool asxy, bool asz) 157 { 158 double mscx, mscy, mscz; 159 PIDrawer3D::ComputeScaleFactor(xmin, xmax, ymin, ymax, zmin, zmax, 160 asxy, asz, mscy, mscz); 161 mscx = 1.; 162 xmin *= mscx; xmax *= mscx; 163 ymin *= mscy; ymax *= mscy; 164 zmin *= mscz; zmax *= mscz; 165 mBDrw->Set3DBox(xmin, xmax, ymin, ymax, zmin, zmax, mscx, mscy, mscz); 166 mBDrw->SetAutoScale(asxy, asz); 167 fixed3DBox = true; 168 169 double D = xmax-xmin; 170 if (D < (ymax-ymin)) D = ymax-ymin; 171 D *= 1.4; 172 Set3DView((xmin+xmax)/2., (ymin+ymax)/2, zmin+(zmax-zmin)*0.40, 173 (xmin+xmax)/2.+D , (ymin+ymax)/2.-2.5*D , zmin+(zmax-zmin)*0.85, 0.25, 0.25); 174 175 } 152 176 153 177 /* --Methode-- */ … … 177 201 178 202 /* --Methode-- */ 203 void PIDraw3DWdg::Refresh() 204 { 205 SetDrawers3DView(); 206 PIBaseWdg::Refresh(); 207 } 208 209 /* --Methode-- */ 179 210 int PIDraw3DWdg::DecodeOptionString(vector<string> & opt, bool rmdecopt) 180 211 { … … 194 225 list<int>::iterator it; 195 226 227 for(it = m3DrIl.begin(); it != m3DrIl.end(); it++) { 196 228 #if defined(CC_HAS_RTTI_SUPPORT) 197 if (vo) for(it = m3DrIl.begin(); it != m3DrIl.end(); it++)229 if (vo) 198 230 (dynamic_cast<PIDrawer3D*>(GetDrawerId(*it)))->Set3DView_Obs(xo, yo, zo, teta, phi, psi, dax, day, co, dco); 199 else for(it = m3DrIl.begin(); it != m3DrIl.end(); it++) 200 (dynamic_cast<PIDrawer3D*>(GetDrawerId(*it)))->Set3DView(xc, yc, zc, xo, yo, zo, dax, day, dco, psi); 231 else 232 (dynamic_cast<PIDrawer3D*>(GetDrawerId(*it)))->Set3DView(xc, yc, zc, xo, yo, zo, dax, day, dco, psi); 233 (dynamic_cast<PIDrawer3D*>(GetDrawerId(*it)))->Copy3DBox(*mBDrw); 201 234 #else 202 if (vo) for(it = m3DrIl.begin(); it != m3DrIl.end(); it++)235 if (vo) 203 236 ((PIDrawer3D*)(GetDrawerId(*it)))->Set3DView_Obs(xo, yo, zo, teta, phi, psi, dax, day, co, dco); 204 else for(it = m3DrIl.begin(); it != m3DrIl.end(); it++) 205 ((PIDrawer3D*)(GetDrawerId(*it)))->Set3DView(xc, yc, zc, xo, yo, zo, dax, day, dco, psi); 237 else 238 ((PIDrawer3D*)(GetDrawerId(*it)))->Set3DView(xc, yc, zc, xo, yo, zo, dax, day, dco, psi); 239 ((PIDrawer3D*)(GetDrawerId(*it)))->Copy3DBox(*mBDrw); 206 240 #endif 241 } 207 242 208 243 } … … 225 260 dr3->Set3DView_Obs(xo, yo, zo, teta, phi, psi, dax, day, co, dco); 226 261 else dr3->Set3DView(xc, yc, zc, xo, yo, zo, dax, day, co, psi); 262 dr3->Copy3DBox(*mBDrw); 227 263 } 228 264 int id = AddDrawer(dr3, false, false, ad, lock); … … 276 312 // <Alt>S active la sensibilite de la zone centrale pour tourner l'objet 277 313 else if (key == 'S' || key == 's') skcfg = !skcfg; 278 else if (key == 'R' || key == 'r') Update3DView(); 314 else if (key == 'R' || key == 'r') Refresh(); 315 else if (key == 'B' || key == 'b') Update3DView(); 279 316 } 280 317 } … … 381 418 SelPointerShape(PI_ArrowPointer); 382 419 mWGrC->SelForeground(lCol); 383 SetDrawers3DView();384 420 Refresh(); 385 421 }
Note:
See TracChangeset
for help on using the changeset viewer.