Revisão | 71e78f98e1041a3599830f4aa961de070971ee98 (tree) |
---|---|
Hora | 2011-01-07 10:43:02 |
Autor | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
rotate molecule are implemented a little.
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/MolDS/trunk@45 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -30,6 +30,7 @@ public: | ||
30 | 30 | void SetInertiaTensorOrigin(double x, double y, double z); |
31 | 31 | void CalcPrincipalAxes(); |
32 | 32 | void Rotate(); |
33 | + void Rotate(EularAngle eularAngle); | |
33 | 34 | void SetRotatingOrigin(double x, double y, double z); |
34 | 35 | void SetRotatingAxis(double x, double y, double z); |
35 | 36 | void SetRotatingAngle(double angle); |
@@ -478,6 +479,7 @@ void Molecule::Rotate(){ | ||
478 | 479 | |
479 | 480 | cout << this->messageStartRotate; |
480 | 481 | |
482 | + // Default values are set if some conditions are not specified. | |
481 | 483 | if(this->rotatingOrigin == NULL){ |
482 | 484 | if(!this->wasCalculatedCOMXyz){ |
483 | 485 | this->CalcCOMXyz(); |
@@ -485,21 +487,30 @@ void Molecule::Rotate(){ | ||
485 | 487 | this->SetRotatingOrigin(this->COMXyz[0], this->COMXyz[1], this->COMXyz[2]); |
486 | 488 | } |
487 | 489 | |
488 | - if(this->rotatingAxis == NULL){ | |
490 | + if(this->rotatingType == Axis && this->rotatingAxis == NULL){ | |
489 | 491 | this->SetRotatingAxis(0.0, 0.0, 1.0); |
490 | 492 | } |
491 | 493 | |
492 | - if(this->rotatingEularAngles == NULL){ | |
494 | + if(this->rotatingType == Eular && this->rotatingEularAngles == NULL){ | |
493 | 495 | this->SetRotatingEularAngles(0.0, 0.0, 0.0); |
494 | 496 | } |
495 | 497 | |
496 | 498 | this->OutputRotatingConditions(); |
497 | 499 | |
498 | - // ToDo: rotate | |
500 | + // rotate | |
501 | + if(this->rotatingType == Axis){ | |
502 | + } | |
503 | + else if(this->rotatingType == Eular){ | |
504 | + this->Rotate(*this->rotatingEularAngles); | |
505 | + } | |
499 | 506 | |
500 | 507 | cout << this->messageDoneRotate; |
501 | 508 | } |
502 | 509 | |
510 | +void Molecule::Rotate(EularAngle eularAngle){ | |
511 | + // ToDo: rotate | |
512 | +} | |
513 | + | |
503 | 514 | void Molecule::OutputRotatingConditions(){ |
504 | 515 | |
505 | 516 | double angst2AU = Parameters::GetInstance()->GetAngstrom2AU(); |