Exemplo n.º 1
0
HorizontalWidget::HorizontalWidget( QWidget* parent )
:QWidget( parent ), sphereRadio( 120.0 ), m_azimuth( 0 ), m_zenith( 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( Text() );
    m_rootNode->addChild( Sphere() );
   	m_rootNode->addChild( Horizon() );
   	m_rootNode->addChild( AzimuthLine() );
   	m_rootNode->addChild( ZenithLine() );
    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_AzimuthLabel = new QLabel;
 	m_AzimuthLabel->setText( "Azimuth:" );
 	labelsLayout->addWidget( m_AzimuthLabel, 0, 0, 1, 1 );

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

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

	m_zenithValue = new QLabel;
 	m_zenithValue->setText( QString::number( m_zenith ) );
 	labelsLayout->addWidget( m_zenithValue, 1, 1, 1, 3 );

}
Exemplo n.º 2
0
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 );
}