Esempio n. 1
0
void GradientDialog::on_buttonBox_clicked( QAbstractButton* button )
{
    if ( button == m_ui.buttonBox->button( QDialogButtonBox::Apply ) ) {
        emit applyGradient( gradient() );
        m_ui.buttonBox->button( QDialogButtonBox::Apply )->setEnabled( false );
    }
}
Esempio n. 2
0
	void Tetra::setVertices() {	
		//VERTICES
		//point 1
		points[0].x = x;
		points[0].y = y;
		points[0].z = z+(h/2.0f); 
		//point 2
		points[1].x = x-(w/2.0f); 
		points[1].y = y+(d/2.0f);
		points[1].z = z-(h/2.0f); 
		//point 3
		points[2].x = x+(w/2.0f); 
		points[2].y = y+(d/2.0f);
		points[2].z = z-(h/2.0f); 
		//point 4
		points[3].x = x; 
		points[3].y = y-(d/2.0f);
		points[3].z = z-(h/2.0f); 
		
		
		//COLORS
		//point 1
		pointColors[0].r = red;
		pointColors[0].g = green;
		pointColors[0].b = blue; 
		
		applyGradient();
		
		//point 2
		pointColors[1].r = red+redShift;
		pointColors[1].g = green+greenShift;
		pointColors[1].b = blue+blueShift; 
		//point 3
		pointColors[2].r = red+redShift;
		pointColors[2].g = green+greenShift;
		pointColors[2].b = blue+blueShift; 
		//point 4
		pointColors[3].r = red+redShift;
		pointColors[3].g = green+greenShift;
		pointColors[3].b = blue+blueShift; 
		
		
		setFaces();
	}
Esempio n. 3
0
	/*Cube::~Cube() {
		Shape::~Shape();
	}*/
	void Cube::setVertices() {	
		//VERTICES
		//point 1
		points[0].x = x-(w/2.0f);
		points[0].y = y+(d/2);
		points[0].z = z+(h/2.0f); 
		//point 2
		points[1].x = x-(w/2.0f); 
		points[1].y = y+(d/2); 
		points[1].z = z-(h/2);
		//point 3
		points[2].x = x+(w/2.0f); 
		points[2].y = y+(d/2.0f);
		points[2].z = z-(h/2.0f); 
		//point 4
		points[3].x = x+(w/2.0f); 
		points[3].y = y+(d/2.0f);
		points[3].z = z+(h/2.0f);
		
		//point 5
		points[4].x = x+(w/2.0f);
		points[4].y = y-(d/2.0f);
		points[4].z = z+(h/2.0f); 
		//point 6
		points[5].x = x+(w/2.0f); 
		points[5].y = y-(d/2.0f);
		points[5].z = z-(h/2.0f); 
		//point 7
		points[6].x = x-(w/2.0f); 
		points[6].y = y-(d/2.0f);
		points[6].z = z-(h/2.0f); 
		//point 8
		points[7].x = x-(w/2.0f); 
		points[7].y = y-(d/2.0f);
		points[7].z = z+(h/2.0f); 

		//COLORS
		//point 1
		pointColors[0].r = red;
		pointColors[0].g = green;
		pointColors[0].b = blue; 
		//point 2
		pointColors[1].r = red;
		pointColors[1].g = green;
		pointColors[1].b = blue; 
		//point 5
		pointColors[4].r = red+redShift;
		pointColors[4].g = green+greenShift;
		pointColors[4].b = blue+blueShift; 
		//point 6
		pointColors[5].r = red+redShift;
		pointColors[5].g = green+greenShift;
		pointColors[5].b = blue+blueShift; 
		
		applyGradient();
		
		//point 3
		pointColors[2].r = red;
		pointColors[2].g = green;
		pointColors[2].b = blue; 
		//point 4
		pointColors[3].r = red;
		pointColors[3].g = green;
		pointColors[3].b = blue;
		//point 7
		pointColors[6].r = red+redShift;
		pointColors[6].g = green+greenShift;
		pointColors[6].b = blue+blueShift; 
		//point 8
		pointColors[7].r = red+redShift;
		pointColors[7].g = green+greenShift;
		pointColors[7].b = blue+blueShift; 
		
		//now assemble faces
		setFaces();
	}
Esempio n. 4
0
void GradientDialog::accept()
{
    emit applyGradient( gradient() );

    QDialog::accept();
}