-
- std::cout<< "# components velocity" << velocity->GetNumberOfComponents()<<std::endl;
-
- double ang1 = 0;
- double ang2 = 0;
-
- ang1 = 1;
- ang2 = 2;
- m_VectorImage->Print(std::cout);
-
- bbSetOutputAngle1(ang1);
- bbSetOutputAngle2(ang2);
-
+ //velocity->Print(std::cout);
+ if (velocity!=NULL)
+ {
+ std::cout<< "# components velocity: " << velocity->GetNumberOfComponents()<<std::endl;
+ std::cout<< "# tuples velocity: " << velocity->GetNumberOfTuples()<<std::endl;
+ vec[0] = velocity->GetComponent(m_idType,0);
+ vec[1] = velocity->GetComponent(m_idType,1);
+ vec[2] = velocity->GetComponent(m_idType,2);
+ std::cout << "velocity :" << vec[0] << "," <<vec[1] << ","<< vec[2] << std::endl;
+ //Miss calcule of angles -----
+ comp = sqrt((vec[0]*vec[0])+(vec[1]*vec[1]));
+ ang1 = atan2(vec[2],comp) * 180 / PI;
+ ang2 = atan2(vec[1],vec[0]) * 180 / PI;
+ //m_VectorImage->Print(std::cout);
+ std::cout << "ang1: " << ang1 << std::endl;
+ std::cout << "ang2: " << ang2 << std::endl;
+ bbSetOutputAngle1(ang1);
+ bbSetOutputAngle2(ang2);
+ bbSetOutputVector(vec);
+ bbSetOutputX(coord[0]);
+ bbSetOutputY(coord[1]);
+ bbSetOutputZ(coord[2]);
+
+ } else {
+ bbSetOutputAngle1(ang1);
+ bbSetOutputAngle2(ang2);
+ bbSetOutputVector(vec);
+ }// if velocity