Text archives Help
- From: roni@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r2024 - in trunk: Core/Geometry UserInterface
- Date: Wed, 30 Jan 2008 23:54:23 -0700 (MST)
Author: roni
Date: Wed Jan 30 23:54:22 2008
New Revision: 2024
Modified:
trunk/Core/Geometry/Vector.h
trunk/UserInterface/XWindowUI.cc
trunk/UserInterface/XWindowUI.h
Log:
Moving projectToSphere() to a more logical, central place.
Modified: trunk/Core/Geometry/Vector.h
==============================================================================
--- trunk/Core/Geometry/Vector.h (original)
+++ trunk/Core/Geometry/Vector.h Wed Jan 30 23:54:22 2008
@@ -575,6 +575,22 @@
return Manta::Vector(Sqrt(v1.data[0]), Sqrt(v1.data[1]),
Sqrt(v1.data[2]));
}
+ inline Vector projectToSphere(Real x, Real y, Real radius)
+ {
+ x /= radius;
+ y /= radius;
+ Real rad2 = x*x+y*y;
+ if(rad2 > 1){
+ Real rad = Sqrt(rad2);
+ x /= rad;
+ y /= rad;
+ return Vector(x,y,0);
+ } else {
+ Real z = Sqrt(1-rad2);
+ return Vector(x,y,z);
+ }
+ }
+
std::ostream& operator<< (std::ostream& os, const Vector& v);
std::istream& operator>> (std::istream& is, Vector& v);
Modified: trunk/UserInterface/XWindowUI.cc
==============================================================================
--- trunk/UserInterface/XWindowUI.cc (original)
+++ trunk/UserInterface/XWindowUI.cc Wed Jan 30 23:54:22 2008
@@ -1078,22 +1078,6 @@
}
}
-Vector XWindowUI::projectToSphere(Real x, Real y, Real radius)
-{
- x /= radius;
- y /= radius;
- Real rad2 = x*x+y*y;
- if(rad2 > 1){
- Real rad = Sqrt(rad2);
- x /= rad;
- y /= rad;
- return Vector(x,y,0);
- } else {
- Real z = Sqrt(1-rad2);
- return Vector(x,y,z);
- }
-}
-
void XWindowUI::animation_callback(int, int, bool& changed)
{
for(size_t i=0;i<interactions.size();i++)
Modified: trunk/UserInterface/XWindowUI.h
==============================================================================
--- trunk/UserInterface/XWindowUI.h (original)
+++ trunk/UserInterface/XWindowUI.h Wed Jan 30 23:54:22 2008
@@ -67,9 +67,6 @@
void shutdown(MantaInterface*);
- // Utility functions
- static Vector projectToSphere(Real x, Real y, Real radius);
-
protected:
void register_default_keys();
void register_default_mouse();
- [Manta] r2024 - in trunk: Core/Geometry UserInterface, roni, 01/31/2008
Archive powered by MHonArc 2.6.16.