• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • htmesh
SpatialEdge.h
Go to the documentation of this file.
1 #ifndef _SpatialEdge_h
2 #define _SpatialEdge_h
3 
4 //# Filename: SpatialEdge.h
5 //#
6 //# SpatialEdge is a helper class for the spatial index at construction
7 //# time.
8 //#
9 //# Author: Peter Z. Kunszt, based on A. Szalay's code
10 //#
11 //# Date: October 15, 1998
12 //#
13 //# Copyright (C) 2000 Peter Z. Kunszt, Alex S. Szalay, Aniruddha R. Thakar
14 //# The Johns Hopkins University
15 //#
16 //# Modification History:
17 //#
18 //# Oct 18, 2001 : Dennis C. Dinge -- Replaced ValVec with std::vector
19 //#
20 
21 #include "SpatialIndex.h"
22 
23 
24 // Forward declarations
25 class SpatialIndex;
26 
27 //########################################################################
28 //
29 // <GROUP>
30 // <SUMMARY>Class declarations</SUMMARY>
31 //
32 
33 //########################################################################
34 //
35 // <SUMMARY> Spatial Edge class </SUMMARY>
36 //
37 // The Edges are needed at construction time of the spatial index.
38 // They are used to generate the midpoints of the nodes in a certain layer.
39 // The interface is simple: construct a class giving it the SpatialIndex
40 // and the layer number. Then call makeMidPoints. The SpatialIndex will
41 // then have its midpoint constructed in every QuadNode.
42 
43 class LINKAGE SpatialEdge {
44 public:
45  // Constructor : give the tree and its layer
46  SpatialEdge(SpatialIndex & tree, size_t layerindex);
47 
48  // Destructor
49  ~SpatialEdge();
50 
51  // Interface to class: generate midpoints.
52  void makeMidPoints();
53 
54 private:
55  struct Edge {
56  size_t start_; // starting vertex index of edge
57  size_t end_; // index of end
58  size_t mid_; // index of center
59  };
60 
61  // Make a new edge, in the temporary edges_ at emindex, at node_[index]
62  // using the k'th side. Since every edge belongs to two faces, we have]
63  // to check whether an edge has been already processed or not (i.e. the
64  // midpoint has been constructed or not). We have a lookup table for
65  // this purpose. Every edge is stored at lTab[start_]. There may be
66  // up to 6 edges in every vertex[start_] so if that table place is occupied,
67  // store it in the next table position (and so on). So we only have to
68  // look up 6 positions at most.
69  size_t newEdge(size_t emindex, size_t index, int k);
70 
71  // insert the edge em into the lookup table
72  void insertLookup(Edge *em);
73 
74  // lookup the edge em in the lookup table
75  Edge * edgeMatch(Edge *em);
76 
77  // generate a new vertex, which is the midpoint of the current edge.
78  size_t getMidPoint(Edge * em);
79 
80  SpatialIndex & tree_; // reference to the tree class
81  size_t layerindex_; // index of the layer
82  Edge ** lTab_; // Edges lookup table
83  Edge * edges_; // Edges array
84  size_t index_; // index of the vertex that is built
85 };
86 
87 // </GROUP>
88 //
89 
90 #endif
SpatialIndex
The Spatial Index is a quad tree of spherical triangles.
Definition: SpatialIndex.h:59
SpatialIndex.h
SpatialEdge
Definition: SpatialEdge.h:43
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal