• 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
  • skycomponents
starblock.h
Go to the documentation of this file.
1 /***************************************************************************
2  starblock.h - K Desktop Planetarium
3  -------------------
4  begin : 8 Jun 2008
5  copyright : (C) 2008 by Akarsh Simha
6  email : akarshsimha@gmail.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef STARBLOCK_H
19 #define STARBLOCK_H
20 
21 #include "typedef.h"
22 #include "starblocklist.h"
23 
24 #include <QVector>
25 
26 class StarObject;
27 class StarBlockList;
28 struct starData;
29 struct deepStarData;
30 
38 class StarBlock
39 {
40 public:
45  explicit StarBlock( int nstars = 100 );
46 
51  ~StarBlock();
52 
62  StarObject* addStar(const starData& data);
63  StarObject* addStar(const deepStarData& data);
64 
70  inline bool isFull() { return nStars == size(); }
71 
81  inline int size() { return stars.size(); }
82 
89  inline StarObject *star( int i ) { return &stars[i]; }
90 
91  // These methods are there because we might want to make faintMag and brightMag private at some point
97  inline float getBrightMag() { return brightMag; }
98 
104  inline float getFaintMag() { return faintMag; }
105 
110  inline int getStarCount() { return nStars; }
111 
115  void reset();
116 
117  float faintMag;
118  float brightMag;
119  StarBlockList *parent;
120  StarBlock *prev;
121  StarBlock *next;
122  quint32 drawID;
123 
124  private:
125  // Disallow copying and assignment. Just in case.
126  StarBlock(const StarBlock&);
127  StarBlock& operator = (const StarBlock&);
128 
130  int nStars;
132  QVector<StarObject> stars;
133 };
134 
135 #endif
deepStarData
Structure that holds star data for really faint stars.
Definition: deepstardata.h:28
starData
Structure that holds star data.
Definition: stardata.h:28
StarBlock::parent
StarBlockList * parent
Definition: starblock.h:119
StarBlock::getBrightMag
float getBrightMag()
Return the magnitude of the brightest star in this StarBlock.
Definition: starblock.h:97
StarBlock
Holds a block of stars and various peripheral variables to mark its place in data structures...
Definition: starblock.h:38
typedef.h
StarBlock::drawID
quint32 drawID
Definition: starblock.h:122
StarBlock::~StarBlock
~StarBlock()
Destructor Deletes all stored stars.
Definition: starblock.cpp:49
StarBlock::star
StarObject * star(int i)
Return the i-th star in this StarBlock.
Definition: starblock.h:89
StarBlock::isFull
bool isFull()
Returns true if the StarBlock is full.
Definition: starblock.h:70
StarBlock::brightMag
float brightMag
Definition: starblock.h:118
StarBlock::size
int size()
Return the capacity of this StarBlock.
Definition: starblock.h:81
StarBlock::next
StarBlock * next
Definition: starblock.h:121
StarBlock::reset
void reset()
Reset this StarBlock's data, for reuse of the StarBl.
Definition: starblock.cpp:39
StarBlock::faintMag
float faintMag
Definition: starblock.h:117
StarBlock::getFaintMag
float getFaintMag()
Return the magnitude of the faintest star in this StarBlock.
Definition: starblock.h:104
StarBlock::getStarCount
int getStarCount()
Return the number of stars currently filled in this StarBlock.
Definition: starblock.h:110
StarBlockList
Maintains a list of StarBlocks that contain the stars lying in a single trixel.
Definition: starblocklist.h:36
starblocklist.h
StarBlock::StarBlock
StarBlock(int nstars=100)
Constructor Initializes values of various parameters and creates nstars number of stars...
Definition: starblock.cpp:27
StarBlock::prev
StarBlock * prev
Definition: starblock.h:120
StarObject
This is a subclass of SkyObject.
Definition: starobject.h:41
StarBlock::addStar
StarObject * addStar(const starData &data)
Initialize another star with data.
Definition: starblock.cpp:55
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