CelestialWidget::CelestialWidget( QWidget* parent )
:QWidget( parent ), sphereRadio( 120.0 ), m_declination( 0 ), m_rightAscension( 0 )
{
	QVBoxLayout* mainLayout = new QVBoxLayout;
	setLayout( mainLayout );

	QWidget* examinerWidget = new QWidget;
	examinerWidget->setFixedSize( 490, 300 );
	mainLayout->addWidget(examinerWidget);

	m_rootNode = new SoSeparator;

	m_rootNode->addChild( Ejes() );
	m_rootNode->addChild( Sphere() );
	m_rootNode->addChild( CelestialEquator() );
	m_rootNode->addChild( Ecliptic() );
	m_rootNode->addChild( Points() );
	m_rootNode->addChild( RightAscension() );
	m_rootNode->addChild( Declination() );
	m_rootNode->addChild( Star() );

	SoQtExaminerViewer* myRenderArea = new SoQtExaminerViewer( examinerWidget );
	myRenderArea->setSceneGraph( m_rootNode );
	SbColor col( 0.86f, 0.86f, 0.86f );
	myRenderArea->setBackgroundColor(col);
	myRenderArea->show( );

	QWidget* labelsWidget = new QWidget;
	mainLayout->addWidget( labelsWidget );
	QGridLayout* labelsLayout = new QGridLayout;
	labelsWidget->setLayout( labelsLayout );

	QLabel* m_rightLabel = new QLabel;
	m_rightLabel->setText( "Right Ascension:" );
	labelsLayout->addWidget( m_rightLabel, 0, 0, 1, 1 );

	m_rightValue = new QLabel;
	m_rightValue->setText( QString::number( m_rightAscension ) );
	labelsLayout->addWidget( m_rightValue, 0, 1, 1, 3 );

	QLabel* m_declinationLabel = new QLabel;
	m_declinationLabel->setText( "Declination:" );
	labelsLayout->addWidget( m_declinationLabel, 1, 0, 1, 1 );

	m_declinationValue = new QLabel;
	m_declinationValue->setText( QString::number( m_declination ) );
	labelsLayout->addWidget( m_declinationValue, 1, 1, 1, 3 );
}
示例#2
0
// ==============================================================================================================================================
//
Orbit::Orbit()
{
	Reset();
	Ecliptic();
}