[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/kstars/kstars/htmesh
From:       Alexey Khudyakov <alexey.skladnoy () gmail ! com>
Date:       2011-02-20 18:03:08
Message-ID: 20110220180308.73F7EAC8CD () svn ! kde ! org
[Download RAW message or body]

SVN commit 1221836 by khudyakov:

Remove dead code from SpatialIndex

 M  +0 -41     SpatialIndex.cpp  
 M  +0 -26     SpatialIndex.h  
 M  +0 -31     SpatialIndex.hxx  


--- trunk/KDE/kdeedu/kstars/kstars/htmesh/SpatialIndex.cpp #1221835:1221836
@@ -240,47 +240,6 @@
   return index_++;
 }
 
-
-float64
-SpatialIndex::area(uint64 ID) const
-{
-
-  SpatialVector n0;
-  SpatialVector n1;
-  SpatialVector n2;
-
-  nodeVertex(ID, n0, n1, n2);
-  return area(n0,n1,n2);
-}
-
-
-/////////////AREA////////////////////////////////////////
-// area: routine to precompute the area of a node using
-//
-//   AREA = 4*arctan sqrt(tan(s/2)tan((s-a)/2)tan((s-b)/2)tan((s-c)/2))
-//
-//   with s = (a+b+c)/2
-//
-// (with many thanks to Eduard Masana, emasana@pchpc10.am.ub.es )
-//
-float64
-SpatialIndex::area(const SpatialVector & v0, 
-		   const SpatialVector & v1,
-		   const SpatialVector & v2) const {
-
-  float64 a = acos( v0 * v1);
-  float64 b = acos( v1 * v2);
-  float64 c = acos( v2 * v0);
-
-  float64 s = (a + b + c)/2.0;
-
-  float64 area = 4.0*atan(sqrt(tan(s/2.0)*
-			       tan((s-a)/2.0)*
-			       tan((s-b)/2.0)*
-			       tan((s-c)/2.0)));        
-  return area;
-}
-
 /////////////VMAX/////////////////////////////////////////
 // vMax: compute the maximum number of vertices for the
 //       polyhedron after buildlevel of subdivisions and
--- trunk/KDE/kdeedu/kstars/kstars/htmesh/SpatialIndex.h #1221835:1221836
@@ -61,9 +61,6 @@
 
 class LINKAGE SpatialIndex {
 public:
-    size_t getMaxlevel(){return maxlevel_;};		// the depth of the Layer
-    size_t getBildLevel(){return buildlevel_;};	// the depth of the Layer storedbuildlevel_;
-
   /** Constructor.
       Give the level of the index and optionally the level to build -
       i.e. the depth to keep in memory.  if maxlevel - buildlevel > 0
@@ -86,15 +83,6 @@
       ascending starting from S0000.. to N3333...  */
   static char * nameById(uint64 ID, char * name = 0);
 
-  /** Return leaf id for a certain bitlist index. 
-      Same as the function above */
-  uint64 idByLeafNumber(uint32 n) const ;
-
-  /** return name for a certain leaf index (to be used for name lookup
-      from a bitlist).  This function is simply shorthand for
-      nameById(n + leafCount()).  */
-  char * nameByLeafNumber(uint32 n, char * name = 0) const;
-
   /** find the vector to the centroid of a triangle represented by 
 	  the ID */
   void pointById(SpatialVector & vector, uint64 ID) const;
@@ -114,20 +102,9 @@
   char* nameByPoint(const float64 & ra, const float64 & dec, 
 		    char* s=NULL) const;
 
-  /// return number of leaf nodes
-  uint64 leafCount() const;
-
   /// return number of vertices
   size_t nVertices() const;
 
-  /// The area in steradians for a given index ID
-  float64 area(uint64 ID) const;
-
-  /// The area in steradians for a given spatial triangle
-  float64 area(const SpatialVector & v1, 
-	       const SpatialVector & v2, 
-	       const SpatialVector & v3) const;
-
   /// return the actual vertex vectors
   void nodeVertex(const uint64 id, 
      		  SpatialVector & v1, 
@@ -138,9 +115,6 @@
   void nodeVertex(const size_t idx, 
 		  size_t & v1, size_t & v2, size_t & v3) const; 
 
-  /// set the maximum depth of the layer
-  void setMaxlevel(int level);
-
 private:
 
   // STRUCTURES
--- trunk/KDE/kdeedu/kstars/kstars/htmesh/SpatialIndex.hxx #1221835:1221836
@@ -10,14 +10,6 @@
 //#                     The Johns Hopkins University
 //#
 
-/////////////leafCount//////////////////////////////////////
-// leafCount: return number of leaf nodes
-inline uint64
-SpatialIndex::leafCount() const
-{
-  return leaves_;
-}
-
 /////////////NVERTICES////////////////////////////////////
 // nVertices: return number of vertices
 inline size_t
@@ -27,26 +19,8 @@
 	return vertices_.size();
 }
 
-//////////////////IDBYLEAFNUMBER///////////////////////////////////////////
-//
-inline uint64
-SpatialIndex::idByLeafNumber(uint32 n) const{
-  uint64 l = leafCount();
-  l += n;
-  return l;
-}
-
-//////////////////NAMEBYLEAFNUMBER////////////////////////////////////////
-//
-inline char *
-SpatialIndex::nameByLeafNumber(uint32 n, char * name) const{
-  return nameById(idByLeafNumber(n), name);
-}
-
 //////////////////IDBYPOINT////////////////////////////////////////////////
 // Find a leaf node where a ra/dec points to
-//
-
 inline uint64
 SpatialIndex::idByPoint(const float64 & ra, const float64 & dec) const {
   SpatialVector v(ra,dec);
@@ -71,8 +45,3 @@
 SpatialIndex::nameByPoint(SpatialVector & vector, char* name) const {
   return nameById(idByPoint(vector),name);
 }
-//////////////////// setMaxlevel /////////////////////////
-inline void
-SpatialIndex::setMaxlevel(int level) {
-	this->maxlevel_ = level;
-}
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic