Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit dc93d605 authored by promayon's avatar promayon
Browse files

FIXED some compilation warnings (uninitialized)

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@545 ec899d31-69d1-42ba-9299-647d76f65fb3
parent ebdb1722
......@@ -234,7 +234,7 @@ Component::Representation Component::getRepresentation() const {
QString representationString;
QString instanciatedMember;
QString shouldInstanciateMember;
bool instanciationError;
bool instanciationError = false;
// check the service
switch ( myService ) {
......
......@@ -94,7 +94,7 @@ void Slice::init() {
pickPlane = NULL;
pickPlaneMapper = NULL;
pickPlaneActor = NULL;
pixelActor = NULL;
pixelActor = NULL;
imgToMapFilter = vtkSmartPointer<vtkImageMapToColors>::New();
image3DActor = vtkSmartPointer<vtkImageActor>::New();
......@@ -619,123 +619,124 @@ void Slice::initPixelActor() {
void Slice::updatePixelActorPosition(double x, double y, double z) {
// if the interactive viewer is not refreshed/displayed, the pixelActor is null. In this case, no point to update it
if (pixelActor) {
// The coordinates of the bounding box around the picked pixel
double xMin, xMax , yMin, yMax;
//--- Update pick plane
double pickPlaneBounds[6];
image2DReslicer->GetOutput()->ComputeBounds();
image2DReslicer->GetOutput()->Update();
image2DReslicer->GetOutput()->GetBounds(pickPlaneBounds);
xMin = pickPlaneBounds[0];
xMax = pickPlaneBounds[1];
yMin = pickPlaneBounds[2];
yMax = pickPlaneBounds[3];
computeReslicedDimensions();
// Compute the bounding box according to the picked pixel
double xBorderMin, xBorderMax, yBorderMin, yBorderMax;
xBorderMin = - x;
xBorderMax = - x + xMin - xMax;
switch (sliceOrientation) {
case AXIAL_ORIENTATION:
yBorderMin = - y;
yBorderMax = - y + yMin - yMax;
break;
default:
yBorderMin = - y;
yBorderMax = - y - yMin + yMax;
break;
}
// Check the orientation of the slice to deduce the depth to draw the pixel actor with its bounding box
RendererWidget::CameraOrientation orientation;
switch(sliceOrientation) {
case AXIAL_ORIENTATION:
orientation = InteractiveViewer::getAxialViewer()->getRendererWidget()->getCameraOrientation();
break;
case CORONAL_ORIENTATION:
orientation = InteractiveViewer::getCoronalViewer()->getRendererWidget()->getCameraOrientation();
break;
case SAGITTAL_ORIENTATION:
orientation = InteractiveViewer::getSagittalViewer()->getRendererWidget()->getCameraOrientation();
break;
default:
break;
}
switch(orientation) {
case RendererWidget::LEFT_UP:
case RendererWidget::RIGHT_DOWN: // camera position has a negative depth
z = -0.01;
break;
case RendererWidget::RIGHT_UP:
z = +0.01;
break;
default:
break;
}
// Create the cloup points used to describe the bounding box around
vtkSmartPointer<vtkPoints> pixelPoints = vtkSmartPointer<vtkPoints>::New();
pixelPoints->SetNumberOfPoints(4);
// Those points describes the (red / blue / green) cross around the picked pixel.
pixelPoints->InsertPoint(0, xBorderMin, 0, z );
pixelPoints->InsertPoint(1, xBorderMax, 0, z );
pixelPoints->InsertPoint(2, 0, yBorderMin, z );
pixelPoints->InsertPoint(3, 0, yBorderMax, z );
// Create the lines crossing the picked pixel
vtkSmartPointer<vtkLine> hLine = vtkSmartPointer<vtkLine>::New();
hLine->GetPointIds()->SetId(0, 0);
hLine->GetPointIds()->SetId(1, 1);
vtkSmartPointer<vtkLine> vLine = vtkSmartPointer<vtkLine>::New();
vLine->GetPointIds()->SetId(0, 2);
vLine->GetPointIds()->SetId(1, 3);
// Create the unstructured grid according to these 2 lines and cloup points
vtkSmartPointer<vtkUnstructuredGrid> aPixelGrid = vtkSmartPointer<vtkUnstructuredGrid>::New();
aPixelGrid->Allocate(2, 2);
aPixelGrid->InsertNextCell( hLine->GetCellType(), hLine->GetPointIds());
aPixelGrid->InsertNextCell( vLine->GetCellType(), vLine->GetPointIds());
aPixelGrid->SetPoints(pixelPoints);
// Create the corresponding mapper
vtkSmartPointer<vtkDataSetMapper> aPixelMapper = vtkSmartPointer<vtkDataSetMapper>::New();
aPixelMapper->SetInput(aPixelGrid);
pixelActor->SetMapper(aPixelMapper);
pixelActor->GetProperty()->SetAmbient(1.0);
pixelActor->GetProperty()->SetDiffuse(1.0);
// Update pixel actor properties
switch (sliceOrientation) {
default:
case ARBITRARY_ORIENTATION:
pixelActor->GetProperty()->SetColor( 1.0, 1.0, 0.0);
break;
case AXIAL_ORIENTATION:
pixelActor->GetProperty()->SetColor( 0.0, 0.0, 1.0);
break;
case CORONAL_ORIENTATION:
pixelActor->GetProperty()->SetColor(0.0, 1.0, 0.0);
break;
case SAGITTAL_ORIENTATION:
pixelActor->GetProperty()->SetColor(1.0, 0.0, 0.0);
break;
}
pixelActor->GetProperty()->SetLineWidth( 1.0 );
pixelActor->SetPosition( x, y, z );
//-- pixelActor can not be picked
pixelActor->PickableOff();
}
// else no point to update the pixelActor
// if the interactive viewer is not refreshed/displayed, the pixelActor is null. In this case, no point to update it
if (pixelActor) {
// The coordinates of the bounding box around the picked pixel
double xMin, xMax , yMin, yMax;
//--- Update pick plane
double pickPlaneBounds[6];
image2DReslicer->GetOutput()->ComputeBounds();
image2DReslicer->GetOutput()->Update();
image2DReslicer->GetOutput()->GetBounds(pickPlaneBounds);
xMin = pickPlaneBounds[0];
xMax = pickPlaneBounds[1];
yMin = pickPlaneBounds[2];
yMax = pickPlaneBounds[3];
computeReslicedDimensions();
// Compute the bounding box according to the picked pixel
double xBorderMin, xBorderMax, yBorderMin, yBorderMax;
xBorderMin = - x;
xBorderMax = - x + xMin - xMax;
switch (sliceOrientation) {
case AXIAL_ORIENTATION:
yBorderMin = - y;
yBorderMax = - y + yMin - yMax;
break;
default:
yBorderMin = - y;
yBorderMax = - y - yMin + yMax;
break;
}
// Check the orientation of the slice to deduce the depth to draw the pixel actor with its bounding box
RendererWidget::CameraOrientation orientation=RendererWidget::RIGHT_UP;
switch(sliceOrientation) {
case AXIAL_ORIENTATION:
orientation = InteractiveViewer::getAxialViewer()->getRendererWidget()->getCameraOrientation();
break;
case CORONAL_ORIENTATION:
orientation = InteractiveViewer::getCoronalViewer()->getRendererWidget()->getCameraOrientation();
break;
case SAGITTAL_ORIENTATION:
orientation = InteractiveViewer::getSagittalViewer()->getRendererWidget()->getCameraOrientation();
break;
default:
break;
}
switch(orientation) {
case RendererWidget::LEFT_UP:
case RendererWidget::RIGHT_DOWN: // camera position has a negative depth
z = -0.01;
break;
case RendererWidget::RIGHT_UP:
z = +0.01;
break;
default:
break;
}
// Create the cloup points used to describe the bounding box around
vtkSmartPointer<vtkPoints> pixelPoints = vtkSmartPointer<vtkPoints>::New();
pixelPoints->SetNumberOfPoints(4);
// Those points describes the (red / blue / green) cross around the picked pixel.
pixelPoints->InsertPoint(0, xBorderMin, 0, z );
pixelPoints->InsertPoint(1, xBorderMax, 0, z );
pixelPoints->InsertPoint(2, 0, yBorderMin, z );
pixelPoints->InsertPoint(3, 0, yBorderMax, z );
// Create the lines crossing the picked pixel
vtkSmartPointer<vtkLine> hLine = vtkSmartPointer<vtkLine>::New();
hLine->GetPointIds()->SetId(0, 0);
hLine->GetPointIds()->SetId(1, 1);
vtkSmartPointer<vtkLine> vLine = vtkSmartPointer<vtkLine>::New();
vLine->GetPointIds()->SetId(0, 2);
vLine->GetPointIds()->SetId(1, 3);
// Create the unstructured grid according to these 2 lines and cloup points
vtkSmartPointer<vtkUnstructuredGrid> aPixelGrid = vtkSmartPointer<vtkUnstructuredGrid>::New();
aPixelGrid->Allocate(2, 2);
aPixelGrid->InsertNextCell( hLine->GetCellType(), hLine->GetPointIds());
aPixelGrid->InsertNextCell( vLine->GetCellType(), vLine->GetPointIds());
aPixelGrid->SetPoints(pixelPoints);
// Create the corresponding mapper
vtkSmartPointer<vtkDataSetMapper> aPixelMapper = vtkSmartPointer<vtkDataSetMapper>::New();
aPixelMapper->SetInput(aPixelGrid);
pixelActor->SetMapper(aPixelMapper);
pixelActor->GetProperty()->SetAmbient(1.0);
pixelActor->GetProperty()->SetDiffuse(1.0);
// Update pixel actor properties
switch (sliceOrientation) {
default:
case ARBITRARY_ORIENTATION:
pixelActor->GetProperty()->SetColor( 1.0, 1.0, 0.0);
break;
case AXIAL_ORIENTATION:
pixelActor->GetProperty()->SetColor( 0.0, 0.0, 1.0);
break;
case CORONAL_ORIENTATION:
pixelActor->GetProperty()->SetColor(0.0, 1.0, 0.0);
break;
case SAGITTAL_ORIENTATION:
pixelActor->GetProperty()->SetColor(1.0, 0.0, 0.0);
break;
}
pixelActor->GetProperty()->SetLineWidth( 1.0 );
pixelActor->SetPosition( x, y, z );
//-- pixelActor can not be picked
pixelActor->PickableOff();
}
// else no point to update the pixelActor
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment