Example #1
0
vtkSmartPointer<vtkGridAxes3DActor> RendererImplementationBase3D::createAxes()
{
    double axesColor[3] = { 0, 0, 0 };
    double labelColor[3] = { 0, 0, 0 };

    auto gridAxes = vtkSmartPointer<vtkGridAxes3DActor>::New();
    gridAxes->SetFaceMask(0xFF);
    gridAxes->GenerateGridOn();
    gridAxes->GenerateEdgesOn();
    gridAxes->GenerateTicksOn();
    gridAxes->EnableLayerSupportOff();

    // we need to set a new vtkProperty object here, otherwise the changes will not apply to all faces/axes
    auto gridAxesProp = vtkSmartPointer<vtkProperty>::New();
    gridAxesProp->DeepCopy(gridAxes->GetProperty());

    gridAxesProp->BackfaceCullingOff();
    gridAxesProp->FrontfaceCullingOn();
    gridAxesProp->SetColor(axesColor);

    gridAxes->SetProperty(gridAxesProp);

    for (int i = 0; i < 3; ++i)
    {
        FontHelper::configureTextProperty(*gridAxes->GetLabelTextProperty(i));
        FontHelper::configureTextProperty(*gridAxes->GetTitleTextProperty(i));
        gridAxes->GetLabelTextProperty(i)->SetColor(labelColor);
        gridAxes->GetTitleTextProperty(i)->SetColor(labelColor);
    }

    // Will be shown when needed
    gridAxes->VisibilityOff();

    return gridAxes;
}
void VolumeRenderWidget::setActorsVisible(int visible)
{
	for (auto m : m_volumeProps)
	{
		auto actor = m->getActor();
		if (visible == 0)
			actor->VisibilityOff();
		else
			actor->VisibilityOn();
	}
	updateRendering();
}