• 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
deepstarcomponent.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  deepstarcomponent.cpp - K Desktop Planetarium
3  -------------------
4  begin : Fri 1st Aug 2008
5  copyright : (C) 2008 Akarsh Simha, Thomas Kabelmann
6  email : akarshsimha@gmail.com, thomas.kabelmann@gmx.de
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 #ifdef _WIN32
19 #include <windows.h>
20 #endif
21 #include "deepstarcomponent.h"
22 
23 #include <QPixmap>
24 
25 #include <QRectF>
26 #include <QFontMetricsF>
27 #include <kglobal.h>
28 
29 #include "Options.h"
30 #include "kstarsdata.h"
31 #include "skymap.h"
32 #include "skyobjects/starobject.h"
33 #include "skymesh.h"
34 #include "binfilehelper.h"
35 #include "starblockfactory.h"
36 #include "starcomponent.h"
37 #include "projections/projector.h"
38 
39 #include "skypainter.h"
40 
41 #include <kde_file.h>
42 #include "byteorder.h"
43 
44 DeepStarComponent::DeepStarComponent( SkyComposite *parent, QString fileName, float trigMag, bool staticstars ) :
45  ListComponent(parent),
46  m_reindexNum( J2000 ),
47  triggerMag( trigMag ),
48  m_FaintMagnitude(-5.0),
49  staticStars( staticstars ),
50  dataFileName( fileName )
51 {
52  fileOpened = false;
53  openDataFile();
54  if( staticStars )
55  loadStaticStars();
56  kDebug() << "Loaded catalog file " << dataFileName << "(hopefully)";
57 }
58 
59 bool DeepStarComponent::loadStaticStars() {
60  FILE *dataFile;
61 
62  if( !staticStars )
63  return true;
64  if( !fileOpened )
65  return false;
66 
67  dataFile = starReader.getFileHandle();
68  rewind( dataFile );
69 
70  if( !starReader.readHeader() ) {
71  kDebug() << "Error reading header of catalog file " << dataFileName << ": " << starReader.getErrorNumber() << ": " << starReader.getError() << endl;
72  return false;
73  }
74 
75  if( starReader.guessRecordSize() != 16 && starReader.guessRecordSize() != 32 ) {
76  kDebug() << "Cannot understand catalog file " << dataFileName << endl;
77  return false;
78  }
79 
80  KDE_fseek(dataFile, starReader.getDataOffset(), SEEK_SET);
81 
82  qint16 faintmag;
83  quint8 htm_level;
84  quint16 t_MSpT;
85 
86  fread( &faintmag, 2, 1, dataFile );
87  if( starReader.getByteSwap() )
88  faintmag = bswap_16( faintmag );
89  fread( &htm_level, 1, 1, dataFile );
90  fread( &t_MSpT, 2, 1, dataFile ); // Unused
91  if( starReader.getByteSwap() )
92  faintmag = bswap_16( faintmag );
93 
94 
95  // TODO: Read the multiplying factor from the dataFile
96  m_FaintMagnitude = faintmag / 100.0;
97 
98  if( htm_level != m_skyMesh->level() )
99  kDebug() << "WARNING: HTM Level in shallow star data file and HTM Level in m_skyMesh do not match. EXPECT TROUBLE" << endl;
100 
101  for(Trixel i = 0; i < (unsigned int)m_skyMesh->size(); ++i) {
102 
103  Trixel trixel = i;
104  StarBlock *SB = new StarBlock( starReader.getRecordCount( i ) );
105  if( !SB )
106  kDebug() << "ERROR: Could not allocate new StarBlock to hold shallow unnamed stars for trixel " << trixel << endl;
107  m_starBlockList.at( trixel )->setStaticBlock( SB );
108 
109  for(unsigned long j = 0; j < (unsigned long) starReader.getRecordCount(i); ++j) {
110  bool fread_success = false;
111  if( starReader.guessRecordSize() == 32 )
112  fread_success = fread( &stardata, sizeof( starData ), 1, dataFile );
113  else if( starReader.guessRecordSize() == 16 )
114  fread_success = fread( &deepstardata, sizeof( deepStarData ), 1, dataFile );
115 
116  if( !fread_success ) {
117  kDebug() << "ERROR: Could not read starData structure for star #" << j << " under trixel #" << trixel << endl;
118  }
119 
120  /* Swap Bytes when required */
121  if( starReader.getByteSwap() ) {
122  if( starReader.guessRecordSize() == 32 )
123  byteSwap( &stardata );
124  else
125  byteSwap( &deepstardata );
126  }
127 
128  /* Initialize star with data just read. */
129  StarObject* star;
130  if( starReader.guessRecordSize() == 32 )
131  star = SB->addStar( stardata );
132  else
133  star = SB->addStar( deepstardata );
134 
135  if( star ) {
136  KStarsData* data = KStarsData::Instance();
137  star->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
138  if( star->getHDIndex() != 0 )
139  m_CatalogNumber.insert( star->getHDIndex(), star );
140  } else {
141  kDebug() << "CODE ERROR: More unnamed static stars in trixel " << trixel << " than we allocated space for!" << endl;
142  }
143  }
144  }
145 
146  return true;
147 }
148 
149 DeepStarComponent::~DeepStarComponent() {
150  if( fileOpened )
151  starReader.closeFile();
152  fileOpened = false;
153 }
154 
155 bool DeepStarComponent::selected() {
156  return Options::showStars() && fileOpened;
157 }
158 
159 bool openIndexFile( ) {
160  // TODO: Work out the details
161  /*
162  if( hdidxReader.openFile( "Henry-Draper.idx" ) )
163  kDebug() << "Could not open HD Index file. Search by HD numbers for deep stars will not work." << endl;
164  */
165  return 0;
166 }
167 
168 //This function is empty for a reason; we override the normal
169 //update function in favor of JiT updates for stars.
170 void DeepStarComponent::update( KSNumbers * )
171 {}
172 
173 // TODO: Optimize draw, if it is worth it.
174 void DeepStarComponent::draw( SkyPainter *skyp ) {
175  if ( !fileOpened ) return;
176 
177  SkyMap *map = SkyMap::Instance();
178  KStarsData* data = KStarsData::Instance();
179  UpdateID updateID = data->updateID();
180 
181  //FIXME_FOV -- maybe not clamp like that...
182  float radius = map->projector()->fov();
183  if ( radius > 90.0 ) radius = 90.0;
184 
185  if ( m_skyMesh != SkyMesh::Instance() && m_skyMesh->inDraw() ) {
186  printf("Warning: aborting concurrent DeepStarComponent::draw()");
187  }
188  bool checkSlewing = ( map->isSlewing() && Options::hideOnSlew() );
189 
190  //shortcuts to inform whether to draw different objects
191  bool hideFaintStars( checkSlewing && Options::hideStars() );
192  double hideStarsMag = Options::magLimitHideStar();
193 
194  //adjust maglimit for ZoomLevel
195 // double lgmin = log10(MINZOOM);
196 // double lgmax = log10(MAXZOOM);
197 // double lgz = log10(Options::zoomFactor());
198  // TODO: Enable hiding of faint stars
199 
200  float maglim = StarComponent::zoomMagnitudeLimit();
201 
202  if( maglim < triggerMag )
203  return;
204 
205  m_zoomMagLimit = maglim;
206 
207  m_skyMesh->inDraw( true );
208 
209  SkyPoint* focus = map->focus();
210  m_skyMesh->aperture( focus, radius + 1.0, DRAW_BUF ); // divide by 2 for testing
211 
212  MeshIterator region(m_skyMesh, DRAW_BUF);
213 
214  magLim = maglim;
215 
216  // If we are to hide the fainter stars (eg: while slewing), we set the magnitude limit to hideStarsMag.
217  if( hideFaintStars && maglim > hideStarsMag )
218  maglim = hideStarsMag;
219 
220  StarBlockFactory *m_StarBlockFactory = StarBlockFactory::Instance();
221  // m_StarBlockFactory->drawID = m_skyMesh->drawID();
222  // kDebug() << "Mesh size = " << m_skyMesh->size() << "; drawID = " << m_skyMesh->drawID();
223  QTime t;
224  int nTrixels = 0;
225 
226  t_dynamicLoad = 0;
227  t_updateCache = 0;
228  t_drawUnnamed = 0;
229 
230  visibleStarCount = 0;
231 
232  t.start();
233 
234  // Mark used blocks in the LRU Cache. Not required for static stars
235  if( !staticStars ) {
236  while( region.hasNext() ) {
237  Trixel currentRegion = region.next();
238  for( int i = 0; i < m_starBlockList.at( currentRegion )->getBlockCount(); ++i ) {
239  StarBlock *prevBlock = ( ( i >= 1 ) ? m_starBlockList.at( currentRegion )->block( i - 1 ) : NULL );
240  StarBlock *block = m_starBlockList.at( currentRegion )->block( i );
241 
242  if( i == 0 && !m_StarBlockFactory->markFirst( block ) )
243  kDebug() << "markFirst failed in trixel" << currentRegion;
244  if( i > 0 && !m_StarBlockFactory->markNext( prevBlock, block ) )
245  kDebug() << "markNext failed in trixel" << currentRegion << "while marking block" << i;
246  if( i < m_starBlockList.at( currentRegion )->getBlockCount()
247  && m_starBlockList.at( currentRegion )->block( i )->getFaintMag() < maglim )
248  break;
249 
250  }
251  }
252  t_updateCache = t.restart();
253  region.reset();
254  }
255 
256  while ( region.hasNext() ) {
257  ++nTrixels;
258  Trixel currentRegion = region.next();
259 
260  // NOTE: We are guessing that the last 1.5/16 magnitudes in the catalog are just additions and the star catalog
261  // is actually supposed to reach out continuously enough only to mag m_FaintMagnitude * ( 1 - 1.5/16 )
262  // TODO: Is there a better way? We may have to change the magnitude tolerance if the catalog changes
263  // Static stars need not execute fillToMag
264 
265  if( !staticStars && !m_starBlockList.at( currentRegion )->fillToMag( maglim ) && maglim <= m_FaintMagnitude * ( 1 - 1.5/16 ) ) {
266  kDebug() << "SBL::fillToMag( " << maglim << " ) failed for trixel "
267  << currentRegion << " !"<< endl;
268  }
269 
270  t_dynamicLoad += t.restart();
271 
272  // kDebug() << "Drawing SBL for trixel " << currentRegion << ", SBL has "
273  // << m_starBlockList[ currentRegion ]->getBlockCount() << " blocks" << endl;
274 
275  for( int i = 0; i < m_starBlockList.at( currentRegion )->getBlockCount(); ++i ) {
276  StarBlock *block = m_starBlockList.at( currentRegion )->block( i );
277  // kDebug() << "---> Drawing stars from block " << i << " of trixel " <<
278  // currentRegion << ". SB has " << block->getStarCount() << " stars" << endl;
279  for( int j = 0; j < block->getStarCount(); j++ ) {
280 
281  StarObject *curStar = block->star( j );
282 
283  // kDebug() << "We claim that he's from trixel " << currentRegion
284  //<< ", and indexStar says he's from " << m_skyMesh->indexStar( curStar );
285 
286  if ( curStar->updateID != updateID )
287  curStar->JITupdate();
288 
289  float mag = curStar->mag();
290 
291  if ( mag > maglim )
292  break;
293 
294  if( skyp->drawPointSource(curStar, mag, curStar->spchar() ) )
295  visibleStarCount++;
296  }
297  }
298 
299  // DEBUG: Uncomment to identify problems with Star Block Factory / preservation of Magnitude Order in the LRU Cache
300  // verifySBLIntegrity();
301  t_drawUnnamed += t.restart();
302 
303  }
304  m_skyMesh->inDraw( false );
305 
306 }
307 
308 bool DeepStarComponent::openDataFile() {
309 
310  if( starReader.getFileHandle() )
311  return true;
312 
313  starReader.openFile( dataFileName );
314  fileOpened = false;
315  if( !starReader.getFileHandle() )
316  kDebug() << "WARNING: Failed to open deep star catalog " << dataFileName << ". Disabling it." << endl;
317  else if( !starReader.readHeader() )
318  kDebug() << "WARNING: Header read error for deep star catalog " << dataFileName << "!! Disabling it!" << endl;
319  else {
320  qint16 faintmag;
321  quint8 htm_level;
322  fread( &faintmag, 2, 1, starReader.getFileHandle() );
323  if( starReader.getByteSwap() )
324  faintmag = bswap_16( faintmag );
325  if( starReader.guessRecordSize() == 16 )
326  m_FaintMagnitude = faintmag / 1000.0;
327  else
328  m_FaintMagnitude = faintmag / 100.0;
329  fread( &htm_level, 1, 1, starReader.getFileHandle() );
330  kDebug() << "Processing " << dataFileName << ", HTMesh Level" << htm_level;
331  m_skyMesh = SkyMesh::Instance( htm_level );
332  if( !m_skyMesh ) {
333  if( !( m_skyMesh = SkyMesh::Create( htm_level ) ) ) {
334  kDebug() << "Could not create HTMesh of level " << htm_level << " for catalog " << dataFileName << ". Skipping it.";
335  return false;
336  }
337  }
338  meshLevel = htm_level;
339  fread( &MSpT, 2, 1, starReader.getFileHandle() );
340  if( starReader.getByteSwap() )
341  MSpT = bswap_16( MSpT );
342  fileOpened = true;
343  kDebug() << " Sky Mesh Size: " << m_skyMesh->size();
344  for (long int i = 0; i < m_skyMesh->size(); i++) {
345  StarBlockList *sbl = new StarBlockList( i, this );
346  if( !sbl ) {
347  kDebug() << "NULL starBlockList. Expect trouble!";
348  }
349  m_starBlockList.append( sbl );
350  }
351  m_zoomMagLimit = 0.06;
352  }
353 
354  return fileOpened;
355 }
356 
357 
358 SkyObject *DeepStarComponent::findByHDIndex( int HDnum ) {
359  // Currently, we only handle HD catalog indexes
360  return m_CatalogNumber.value( HDnum, NULL ); // TODO: Maybe, make this more general.
361 }
362 
363 // This uses the main star index for looking up nearby stars but then
364 // filters out objects with the generic name "star". We could easily
365 // build an index for just the named stars which would make this go
366 // much faster still. -jbb
367 //
368 
369 
370 SkyObject* DeepStarComponent::objectNearest( SkyPoint *p, double &maxrad )
371 {
372  StarObject *oBest = 0;
373 
374  if( !fileOpened )
375  return NULL;
376 
377  m_skyMesh->index( p, maxrad + 1.0, OBJ_NEAREST_BUF);
378 
379  MeshIterator region( m_skyMesh, OBJ_NEAREST_BUF );
380 
381  while ( region.hasNext() ) {
382  Trixel currentRegion = region.next();
383  for( int i = 0; i < m_starBlockList.at( currentRegion )->getBlockCount(); ++i ) {
384  StarBlock *block = m_starBlockList.at( currentRegion )->block( i );
385  for( int j = 0; j < block->getStarCount(); ++j ) {
386  StarObject* star = block->star( j );
387  if( !star ) continue;
388  if ( star->mag() > m_zoomMagLimit ) continue;
389 
390  double r = star->angularDistanceTo( p ).Degrees();
391  if ( r < maxrad ) {
392  oBest = star;
393  maxrad = r;
394  }
395  }
396  }
397  }
398 
399  // TODO: What if we are looking around a point that's not on
400  // screen? objectNearest() will need to keep on filling up all
401  // trixels around the SkyPoint to find the best match in case it
402  // has not been found. Ideally, this should be implemented in a
403  // different method and should be called after all other
404  // candidates (eg: DeepSkyObject::objectNearest()) have been
405  // called.
406 
407  return oBest;
408 }
409 
410 bool DeepStarComponent::starsInAperture( QList<StarObject *> &list, const SkyPoint &center, float radius, float maglim )
411 {
412 
413  if( maglim < triggerMag )
414  return false;
415 
416  // For DeepStarComponents, whether we use ra0() and dec0(), or
417  // ra() and dec(), should not matter, because the stars are
418  // repeated in all trixels that they will pass through, although
419  // the factuality of this statement needs to be verified
420 
421  // Ensure that we have deprecessed the (RA, Dec) to (RA0, Dec0)
422  Q_ASSERT( center.ra0().Degrees() >= 0.0 );
423  Q_ASSERT( center.dec0().Degrees() <= 90.0 );
424 
425  m_skyMesh->intersect( center.ra0().Degrees(), center.dec0().Degrees(), radius, (BufNum) OBJ_NEAREST_BUF );
426 
427  MeshIterator region( m_skyMesh, OBJ_NEAREST_BUF );
428 
429  if( maglim < -28 )
430  maglim = m_FaintMagnitude;
431 
432  while ( region.hasNext() ) {
433  Trixel currentRegion = region.next();
434  // FIXME: Build a better way to iterate over all stars.
435  // Ideally, StarBlockList should have such a facility.
436  StarBlockList *sbl = m_starBlockList[ currentRegion ];
437  sbl->fillToMag( maglim );
438  for( int i = 0; i < sbl->getBlockCount(); ++i ) {
439  StarBlock *block = sbl->block( i );
440  for( int j = 0; j < block->getStarCount(); ++j ) {
441  StarObject *star = block->star( j );
442  if( star->mag() > maglim )
443  break; // Stars are organized by magnitude, so this should work
444  if( star->angularDistanceTo( &center ).Degrees() <= radius )
445  list.append( star );
446  }
447  }
448  }
449 
450  return true;
451 }
452 
453 void DeepStarComponent::byteSwap( deepStarData *stardata ) {
454  stardata->RA = bswap_32( stardata->RA );
455  stardata->Dec = bswap_32( stardata->Dec );
456  stardata->dRA = bswap_16( stardata->dRA );
457  stardata->dDec = bswap_16( stardata->dDec );
458  stardata->B = bswap_16( stardata->B );
459  stardata->V = bswap_16( stardata->V );
460 }
461 
462 void DeepStarComponent::byteSwap( starData *stardata ) {
463  stardata->RA = bswap_32( stardata->RA );
464  stardata->Dec = bswap_32( stardata->Dec );
465  stardata->dRA = bswap_32( stardata->dRA );
466  stardata->dDec = bswap_32( stardata->dDec );
467  stardata->parallax = bswap_32( stardata->parallax );
468  stardata->HD = bswap_32( stardata->HD );
469  stardata->mag = bswap_16( stardata->mag );
470  stardata->bv_index = bswap_16( stardata->bv_index );
471 }
472 
473 bool DeepStarComponent::verifySBLIntegrity() {
474  float faintMag = -5.0;
475  bool integrity = true;
476  for(Trixel trixel = 0; trixel < (unsigned int)m_skyMesh->size(); ++trixel) {
477  for(int i = 0; i < m_starBlockList[ trixel ]->getBlockCount(); ++i) {
478  StarBlock *block = m_starBlockList[ trixel ]->block( i );
479  if( i == 0 )
480  faintMag = block->getBrightMag();
481  // NOTE: Assumes 2 decimal places in magnitude field. TODO: Change if it ever does change
482  if( block->getBrightMag() != faintMag && ( block->getBrightMag() - faintMag ) > 0.5) {
483  kDebug() << "Trixel " << trixel << ": ERROR: faintMag of prev block = " << faintMag
484  << ", brightMag of block #" << i << " = " << block->getBrightMag();
485  integrity = false;
486  }
487  if( i > 1 && ( !block->prev ) )
488  kDebug() << "Trixel " << trixel << ": ERROR: Block" << i << "is unlinked in LRU Cache";
489  if( block->prev && block->prev->parent == m_starBlockList[ trixel ]
490  && block->prev != m_starBlockList[ trixel ]->block( i - 1 ) ) {
491  kDebug() << "Trixel " << trixel << ": ERROR: SBF LRU Cache linked list seems to be broken at before block " << i << endl;
492  integrity = false;
493  }
494  faintMag = block->getFaintMag();
495  }
496  }
497  return integrity;
498 }
starData::mag
qint16 mag
Definition: stardata.h:35
SkyMesh::inDraw
bool inDraw()
Definition: skymesh.h:296
deepStarData
Structure that holds star data for really faint stars.
Definition: deepstardata.h:28
SkyPainter::drawPointSource
virtual bool drawPointSource(SkyPoint *loc, float mag, char sp= 'A')=0
Draw a point source (e.g., a star).
DeepStarComponent::findByHDIndex
SkyObject * findByHDIndex(int HDnum)
Definition: deepstarcomponent.cpp:358
DeepStarComponent::draw
void draw(SkyPainter *skyp)
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
Definition: deepstarcomponent.cpp:174
starData
Structure that holds star data.
Definition: stardata.h:28
SkyPoint::dec0
const dms & dec0() const
Definition: skypoint.h:168
StarObject::JITupdate
void JITupdate()
added for JIT updates from both StarComponent and ConstellationLines
Definition: starobject.cpp:317
KStarsData
KStarsData is the backbone of KStars.
Definition: kstarsdata.h:66
starData::RA
qint32 RA
Definition: stardata.h:29
StarBlock::parent
StarBlockList * parent
Definition: starblock.h:119
KStarsData::updateID
unsigned int updateID()
Definition: kstarsdata.h:224
StarBlock::getBrightMag
float getBrightMag()
Return the magnitude of the brightest star in this StarBlock.
Definition: starblock.h:97
deepStarData::dDec
qint16 dDec
Definition: deepstardata.h:32
StarBlock
Holds a block of stars and various peripheral variables to mark its place in data structures...
Definition: starblock.h:38
StarBlockFactory::markFirst
bool markFirst(StarBlock *block)
Mark a StarBlock as most recently used and sync its drawID with the current drawID.
Definition: starblockfactory.cpp:79
Options::hideStars
static bool hideStars()
Get Hide faint stars while moving?
Definition: Options.h:1322
deepStarData::RA
qint32 RA
Definition: deepstardata.h:29
DeepStarComponent::starsInAperture
bool starsInAperture(QList< StarObject * > &list, const SkyPoint &center, float radius, float maglim=-29)
Add to the given list, the stars from this component, that lie within the specified circular aperture...
Definition: deepstarcomponent.cpp:410
starData::dRA
qint32 dRA
Definition: stardata.h:31
DeepStarComponent::DeepStarComponent
DeepStarComponent(SkyComposite *parent, QString fileName, float trigMag, bool staticstars=false)
Definition: deepstarcomponent.cpp:44
KStarsData::lst
dms * lst()
Definition: kstarsdata.h:161
KStarsData::Instance
static KStarsData * Instance()
Definition: kstarsdata.h:92
dms::Degrees
const double & Degrees() const
Definition: dms.h:98
starcomponent.h
UpdateID
quint32 UpdateID
Definition: skycomponents/typedef.h:41
BinFileHelper::closeFile
void closeFile()
Close the binary data file.
Definition: binfilehelper.cpp:223
SkyMesh::Create
static SkyMesh * Create(int level)
Definition: skymesh.cpp:36
skypainter.h
DeepStarComponent::openDataFile
bool openDataFile()
Definition: deepstarcomponent.cpp:308
KStarsData::geo
GeoLocation * geo()
Definition: kstarsdata.h:164
openIndexFile
bool openIndexFile()
Definition: deepstarcomponent.cpp:159
HTMesh::size
int size() const
Definition: HTMesh.h:125
SkyPoint::ra0
const dms & ra0() const
Definition: skypoint.h:165
ListComponent
An abstract parent class, to be inherited by SkyComponents that store a QList of SkyObjects.
Definition: listcomponent.h:36
Options::hideOnSlew
static bool hideOnSlew()
Get Hide objects while moving?
Definition: Options.h:1094
StarBlockList::getBlockCount
int getBlockCount()
Returns the total number of blocks in theis StarBlockList.
Definition: starblocklist.h:100
HTMesh::intersect
void intersect(double ra, double dec, double radius, BufNum bufNum=0)
finds the trixels that cover the specified circle
Definition: HTMesh.cpp:99
deepStarData::Dec
qint32 Dec
Definition: deepstardata.h:30
BinFileHelper::getRecordCount
unsigned int getRecordCount(int id)
Returns the number of records under the given index ID.
Definition: binfilehelper.h:146
BinFileHelper::getError
QString getError()
Get error string.
Definition: binfilehelper.cpp:234
BinFileHelper::getFileHandle
FILE * getFileHandle()
Get the file handle corresponding to the currently open file.
Definition: binfilehelper.h:132
StarBlock::star
StarObject * star(int i)
Return the i-th star in this StarBlock.
Definition: starblock.h:89
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
SkyMesh::aperture
void aperture(SkyPoint *center, double radius, MeshBufNum_t bufNum=DRAW_BUF)
finds the set of trixels that cover the circular aperture specified after first performing a reverse ...
Definition: skymesh.cpp:66
StarObject::updateID
quint64 updateID
Definition: starobject.h:265
BinFileHelper::openFile
FILE * openFile(const QString &fileName)
WARNING: This function may not be compatible in other locales, because it calls QString::toAscii.
Definition: binfilehelper.cpp:69
StarBlockFactory
A factory that creates StarBlocks and recycles them in an LRU Cache.
Definition: starblockfactory.h:32
starData::Dec
qint32 Dec
Definition: stardata.h:30
SkyMap::focus
SkyPoint * focus()
Retrieve the Focus point; the position on the sky at the center of the skymap.
Definition: skymap.h:120
BinFileHelper::guessRecordSize
int guessRecordSize()
Return a guessed record size.
Definition: binfilehelper.h:167
BinFileHelper::getErrorNumber
int getErrorNumber()
Get error number.
Definition: binfilehelper.cpp:228
bswap_32
#define bswap_32(x)
Definition: byteorder.h:52
BinFileHelper::getDataOffset
long getDataOffset()
Returns the offset at which the data begins.
Definition: binfilehelper.h:194
Projector::fov
double fov() const
Return the FOV of this projection.
Definition: projector.cpp:88
starData::bv_index
qint16 bv_index
Definition: stardata.h:36
DeepStarComponent::update
void update(KSNumbers *num)
Update the sky positions of this component.
Definition: deepstarcomponent.cpp:170
StarComponent::zoomMagnitudeLimit
static float zoomMagnitudeLimit()
Definition: starcomponent.cpp:199
StarObject::getHDIndex
int getHDIndex() const
Definition: starobject.h:226
deepStarData::V
qint16 V
Definition: deepstardata.h:34
SkyMap::isSlewing
bool isSlewing() const
Definition: skymap.cpp:1133
DeepStarComponent::verifySBLIntegrity
bool verifySBLIntegrity()
Definition: deepstarcomponent.cpp:473
skymap.h
starblockfactory.h
starData::dDec
qint32 dDec
Definition: stardata.h:32
DeepStarComponent::~DeepStarComponent
virtual ~DeepStarComponent()
Definition: deepstarcomponent.cpp:149
SkyMesh::Instance
static SkyMesh * Instance()
Definition: skymesh.cpp:48
SkyComposite
SkyComposite is a kind of container class for SkyComponent objects.
Definition: skycomposite.h:43
BinFileHelper::getByteSwap
bool getByteSwap()
Should we do byte swapping?
Definition: binfilehelper.h:159
DeepStarComponent::m_StarBlockFactory
static StarBlockFactory m_StarBlockFactory
Definition: deepstarcomponent.h:118
BufNum
unsigned short BufNum
Definition: htmesh/typedef.h:5
StarObject::spchar
char spchar() const
Returns just the first character of the spectral type string.
Definition: starobject.cpp:344
byteorder.h
SkyPoint::EquatorialToHorizontal
void EquatorialToHorizontal(const dms *LST, const dms *lat)
Determine the (Altitude, Azimuth) coordinates of the SkyPoint from its (RA, Dec) coordinates, given the local sidereal time and the observer's latitude.
Definition: skypoint.cpp:55
DRAW_BUF
Definition: skymesh.h:52
Trixel
unsigned int Trixel
Definition: htmesh/typedef.h:4
BinFileHelper::readHeader
bool readHeader()
Read the header and index table from the file and fill up the QVector s with the entries.
Definition: binfilehelper.cpp:200
MeshIterator
Definition: MeshIterator.h:22
Options.h
MeshIterator::hasNext
bool hasNext() const
Definition: MeshIterator.h:29
binfilehelper.h
SkyObject::mag
float mag(void) const
Definition: skyobject.h:182
KSNumbers
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition: ksnumbers.h:43
OBJ_NEAREST_BUF
Definition: skymesh.h:54
GeoLocation::lat
const dms * lat() const
Definition: geolocation.h:79
deepStarData::dRA
qint16 dRA
Definition: deepstardata.h:31
deepstarcomponent.h
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
J2000
#define J2000
Definition: kstarsdatetime.h:21
Options::magLimitHideStar
static double magLimitHideStar()
Get Faint limit for stars when slewing.
Definition: Options.h:2645
StarBlockFactory::Instance
static StarBlockFactory * Instance()
Definition: starblockfactory.cpp:29
StarBlockFactory::markNext
bool markNext(StarBlock *after, StarBlock *block)
Rank a given StarBlock after another given StarBlock in the LRU list and sync its drawID with the cur...
Definition: starblockfactory.cpp:117
HTMesh::level
int level() const
Definition: HTMesh.h:129
starobject.h
SkyMap
This is the canvas on which the sky is painted.
Definition: skymap.h:72
projector.h
deepStarData::B
qint16 B
Definition: deepstardata.h:33
DeepStarComponent::loadStaticStars
bool loadStaticStars()
Definition: deepstarcomponent.cpp:59
SkyMap::Instance
static SkyMap * Instance()
Definition: skymap.cpp:141
StarBlockList
Maintains a list of StarBlocks that contain the stars lying in a single trixel.
Definition: starblocklist.h:36
MeshIterator::reset
void reset() const
Definition: MeshIterator.h:42
DeepStarComponent::objectNearest
SkyObject * objectNearest(SkyPoint *p, double &maxrad)
Definition: deepstarcomponent.cpp:370
starData::HD
qint32 HD
Definition: stardata.h:34
MeshIterator::next
Trixel next() const
Definition: MeshIterator.h:33
Options::showStars
static bool showStars()
Get Draw stars in the sky map?
Definition: Options.h:2177
kstarsdata.h
StarBlockList::fillToMag
bool fillToMag(float maglim)
Ensures that the list is loaded with stars to given magnitude limit.
Definition: starblocklist.cpp:66
skymesh.h
starData::parallax
qint32 parallax
Definition: stardata.h:33
bswap_16
#define bswap_16(x)
Definition: byteorder.h:47
DeepStarComponent::selected
bool selected()
Definition: deepstarcomponent.cpp:155
StarBlock::prev
StarBlock * prev
Definition: starblock.h:120
StarObject
This is a subclass of SkyObject.
Definition: starobject.h:41
SkyObject
Provides all necessary information about an object in the sky: its coordinates, name(s), type, magnitude, and QStringLists of URLs for images and webpages regarding the object.
Definition: skyobject.h:46
SkyMesh::index
Trixel index(const SkyPoint *p)
Definition: skymesh.cpp:93
SkyMap::projector
const Projector * projector() const
Get the current projector.
Definition: skymap.h:264
SkyPainter
Draws things on the sky, without regard to backend.
Definition: skypainter.h:47
DeepStarComponent::byteSwap
static void byteSwap(deepStarData *stardata)
Definition: deepstarcomponent.cpp:453
SkyPoint::angularDistanceTo
dms angularDistanceTo(const SkyPoint *sp, double *const positionAngle=0) const
Computes the angular distance between two SkyObjects.
Definition: skypoint.cpp:608
StarBlock::addStar
StarObject * addStar(const starData &data)
Initialize another star with data.
Definition: starblock.cpp:55
StarBlockList::block
StarBlock * block(unsigned int i)
Returns the i-th block in this StarBlockList.
Definition: starblocklist.h:88
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:19 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