Example #1
0
void BccWorld::draw()
{
    // BoundingBox box;
    // m_grid->getBounding(box);
    
    // glColor3f(.21f, .21f, .21f);
    // m_drawer->boundingBox(box);
    
    // m_grid->draw(m_drawer, (unsigned *)m_mesh.m_anchorBuf->data());

	drawTetrahedronMesh();
	drawAnchor();
	drawTriangleMesh();
    
	glDisable(GL_DEPTH_TEST);
    // glColor3f(.59f, .02f, 0.f);
    // drawCurves();
	// drawCurveStars();
	
	const unsigned selectedCurveGrp = m_cluster->currentGroup();
	if(m_cluster->isGroupIdValid(selectedCurveGrp)) {
		m_drawer->setGroupColorLight(selectedCurveGrp);
		m_drawer->geometry(m_cluster->group(selectedCurveGrp));
	}
	
	// m_drawer->drawKdTree(m_triIntersect);
}
void SeedGLWidget::paintGL()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	int viewportWidth = _viewportHeight*(_widgetWidth-_planeWidth)*1.0/_widgetHeight;

	int anchorWidth = 200, anchorHeight = 200;

	glViewport(0,0,_widgetWidth-_planeWidth, _widgetHeight);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glOrtho(0, viewportWidth, 0, _viewportHeight, -2000, 2000);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();

	glEnable(GL_DEPTH_TEST);
	glPushMatrix();
	glTranslatef(_translateX, _translateY, 0);
	glTranslatef(viewportWidth/2.0, _viewportHeight/2.0, 0);
	setRotationMatrix();

	glColor3f(1, 1, 1);
	if (_volumeData)
	{
		switch (_viewpoint)
		{
		case VP_AXIAL:
			_volumeData->drawAxialSlice();
			break;
		case VP_CORONAL:
			_volumeData->drawCoronalSlice();
			break;
		case VP_SAGITTAL:
			_volumeData->drawSagittalSlice();
			break;
		}
	}

	drawSeedRegion();

	glPopMatrix();

	if (_bDrawing)
	{
		drawPenTrack();
	}

	glViewport(_widgetWidth-_planeWidth-anchorWidth, 0, anchorWidth, anchorHeight);
	drawAnchor();

	drawImageInfo();
	drawPlanes(_widgetWidth-_planeWidth, _planeWidth, _widgetHeight);
}