Commit e75fe426 authored by Francois Bertel's avatar Francois Bertel

COMP:Fixed warnings about old-style casts. Removed some useless casts.

parent 2c7d96f9
......@@ -31,7 +31,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkActor, "1.136");
vtkCxxRevisionMacro(vtkActor, "1.137");
vtkCxxSetObjectMacro(vtkActor,Texture,vtkTexture);
vtkCxxSetObjectMacro(vtkActor,Mapper,vtkMapper);
......@@ -104,7 +104,7 @@ vtkActor *vtkActor::New()
{
// First try to create the object from the vtkGraphicsFactory
vtkObject* ret = vtkGraphicsFactory::CreateInstance("vtkActor");
return (vtkActor*)ret;
return static_cast<vtkActor *>(ret);
}
//----------------------------------------------------------------------------
......@@ -259,7 +259,7 @@ int vtkActor::HasTranslucentPolygonalGeometry()
//----------------------------------------------------------------------------
void vtkActor::ReleaseGraphicsResources(vtkWindow *win)
{
vtkRenderWindow *renWin = (vtkRenderWindow *)win;
vtkRenderWindow *renWin = static_cast<vtkRenderWindow *>(win);
// pass this information onto the mapper
if (this->Mapper)
......@@ -512,7 +512,7 @@ vtkActor *vtkActor::GetNextPart()
vtkAssemblyNode *node = path->GetLastNode();
if ( node && node->GetViewProp()->IsA("vtkActor") )
{
return (vtkActor *)node->GetViewProp();
return static_cast<vtkActor *>(node->GetViewProp());
}
}
return NULL;
......
......@@ -36,7 +36,7 @@
#include "vtkPoints.h"
#include "vtkExtractSelectedFrustum.h"
vtkCxxRevisionMacro(vtkAreaPicker, "1.14");
vtkCxxRevisionMacro(vtkAreaPicker, "1.15");
vtkStandardNewMacro(vtkAreaPicker);
//--------------------------------------------------------------------------
......@@ -263,7 +263,7 @@ int vtkAreaPicker::PickProps(vtkRenderer *renderer)
picked = 1;
if ( ! this->Prop3Ds->IsItemPresent(prop) )
{
this->Prop3Ds->AddItem((vtkProp3D *)prop);
this->Prop3Ds->AddItem(static_cast<vtkProp3D *>(prop));
//cerr << "picked a mapper" << endl;
if (dist < mindist) //new nearest, remember it
{
......@@ -287,7 +287,7 @@ int vtkAreaPicker::PickProps(vtkRenderer *renderer)
this->DataSet = NULL;
}
}
((vtkProp3D *)propCandidate)->Pick();
static_cast<vtkProp3D *>(propCandidate)->Pick();
this->InvokeEvent(vtkCommand::PickEvent,NULL);
}
}
......
......@@ -22,7 +22,7 @@
#include "vtkRenderWindow.h"
#include "vtkVolume.h"
vtkCxxRevisionMacro(vtkAssembly, "1.58");
vtkCxxRevisionMacro(vtkAssembly, "1.59");
vtkStandardNewMacro(vtkAssembly);
// Construct object with no children.
......@@ -93,13 +93,13 @@ int vtkAssembly::RenderTranslucentPolygonalGeometry(vtkViewport *ren)
// for allocating render time between components
// simple equal allocation
fraction = this->AllocatedRenderTime
/ (double)(this->Paths->GetNumberOfItems());
/ static_cast<double>(this->Paths->GetNumberOfItems());
// render the Paths
vtkCollectionSimpleIterator sit;
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
prop3D = (vtkProp3D *)path->GetLastNode()->GetViewProp();
prop3D = static_cast<vtkProp3D *>(path->GetLastNode()->GetViewProp());
if ( prop3D->GetVisibility() )
{
prop3D->SetAllocatedRenderTime(fraction, ren);
......@@ -128,7 +128,7 @@ int vtkAssembly::HasTranslucentPolygonalGeometry()
vtkCollectionSimpleIterator sit;
for ( this->Paths->InitTraversal(sit); !result && (path = this->Paths->GetNextPath(sit)); )
{
prop3D = (vtkProp3D *)path->GetLastNode()->GetViewProp();
prop3D = static_cast<vtkProp3D *>(path->GetLastNode()->GetViewProp());
if ( prop3D->GetVisibility() )
{
result = prop3D->HasTranslucentPolygonalGeometry();
......@@ -156,13 +156,13 @@ int vtkAssembly::RenderVolumetricGeometry(vtkViewport *ren)
// for allocating render time between components
// simple equal allocation
fraction = this->AllocatedRenderTime
/ (double)(this->Paths->GetNumberOfItems());
/ static_cast<double>(this->Paths->GetNumberOfItems());
// render the Paths
vtkCollectionSimpleIterator sit;
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
prop3D = (vtkProp3D *)path->GetLastNode()->GetViewProp();
prop3D = static_cast<vtkProp3D *>(path->GetLastNode()->GetViewProp());
if ( prop3D->GetVisibility() )
{
prop3D->SetAllocatedRenderTime(fraction, ren);
......@@ -194,13 +194,13 @@ int vtkAssembly::RenderOpaqueGeometry(vtkViewport *ren)
// for allocating render time between components
// simple equal allocation
fraction = this->AllocatedRenderTime
/ (double)(this->Paths->GetNumberOfItems());
/ static_cast<double>(this->Paths->GetNumberOfItems());
// render the Paths
vtkCollectionSimpleIterator sit;
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
prop3D = (vtkProp3D *)path->GetLastNode()->GetViewProp();
prop3D = static_cast<vtkProp3D *>(path->GetLastNode()->GetViewProp());
if ( prop3D->GetVisibility() )
{
prop3D->PokeMatrix(path->GetLastNode()->GetMatrix());
......@@ -237,7 +237,7 @@ void vtkAssembly::GetActors(vtkPropCollection *ac)
vtkCollectionSimpleIterator sit;
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
prop3D = (vtkProp3D *)path->GetLastNode()->GetViewProp();
prop3D = static_cast<vtkProp3D *>(path->GetLastNode()->GetViewProp());
if ( (actor = vtkActor::SafeDownCast(prop3D)) != NULL )
{
ac->AddItem(actor);
......@@ -255,7 +255,7 @@ void vtkAssembly::GetVolumes(vtkPropCollection *ac)
vtkCollectionSimpleIterator sit;
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
prop3D = (vtkProp3D *)path->GetLastNode()->GetViewProp();
prop3D = static_cast<vtkProp3D *>(path->GetLastNode()->GetViewProp());
if ( (volume = vtkVolume::SafeDownCast(prop3D)) != NULL )
{
ac->AddItem(volume);
......@@ -370,7 +370,7 @@ double *vtkAssembly::GetBounds()
vtkCollectionSimpleIterator sit;
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
prop3D = (vtkProp3D *)path->GetLastNode()->GetViewProp();
prop3D = static_cast<vtkProp3D *>(path->GetLastNode()->GetViewProp());
if ( prop3D->GetVisibility() )
{
propVisible = 1;
......
......@@ -24,7 +24,7 @@
#include "vtkWindow.h"
#include "vtkMath.h"
vtkCxxRevisionMacro(vtkAxisActor2D, "1.50");
vtkCxxRevisionMacro(vtkAxisActor2D, "1.51");
vtkStandardNewMacro(vtkAxisActor2D);
vtkCxxSetObjectMacro(vtkAxisActor2D,LabelTextProperty,vtkTextProperty);
......@@ -370,15 +370,15 @@ void vtkAxisActor2D::BuildAxis(vtkViewport *viewport)
// We'll do our computation in viewport coordinates. First determine the
// location of the endpoints.
x = this->PositionCoordinate->GetComputedViewportValue(viewport);
p1[0] = (double)x[0];
p1[1] = (double)x[1];
p1[0] = x[0];
p1[1] = x[1];
p1[2] = 0.0;
this->LastPosition[0] = x[0];
this->LastPosition[1] = x[1];
x = this->Position2Coordinate->GetComputedViewportValue(viewport);
p2[0] = (double)x[0];
p2[1] = (double)x[1];
p2[0] = x[0];
p2[1] = x[1];
p2[2] = 0.0;
this->LastPosition2[0] = x[0];
this->LastPosition2[1] = x[1];
......@@ -476,7 +476,7 @@ void vtkAxisActor2D::BuildAxis(vtkViewport *viewport)
{
for (i = 0; i < this->AdjustedNumberOfLabels; i++)
{
val = this->AdjustedRange[0] + (double)i * interval;
val = this->AdjustedRange[0] + i * interval;
sprintf(string, this->LabelFormat, val);
this->LabelMappers[i]->SetInput(string);
......@@ -860,8 +860,8 @@ void vtkAxisActor2D::SetOffsetPosition(double xTick[3], double theta,
center[0] = xTick[0] + x*sin(theta);
center[1] = xTick[1] - y*cos(theta);
pos[0] = (int)(center[0] - stringWidth/2.0);
pos[1] = (int)(center[1] - stringHeight/2.0);
pos[0] = static_cast<int>(center[0] - stringWidth/2.0);
pos[1] = static_cast<int>(center[1] - stringHeight/2.0);
actor->SetPosition(pos[0], pos[1]);
}
......
......@@ -49,7 +49,7 @@ public:
//-----------------------------------------------------------------------------
vtkCxxRevisionMacro(vtkCellCenterDepthSort, "1.3");
vtkCxxRevisionMacro(vtkCellCenterDepthSort, "1.4");
vtkStandardNewMacro(vtkCellCenterDepthSort);
vtkCellCenterDepthSort::vtkCellCenterDepthSort()
......@@ -214,7 +214,8 @@ vtkIdTypeArray *vtkCellCenterDepthSort::GetNextCells()
{
vtkIdType left = partition.first;
vtkIdType right = partition.second - 1;
float pivot = cellDepths[(vtkIdType)vtkMath::Random(left, right)];
float pivot = cellDepths[static_cast<vtkIdType>(
vtkMath::Random(left, right))];
while (left <= right)
{
while ((left <= right) && (cellDepths[left] < pivot)) left++;
......
......@@ -21,7 +21,7 @@
#include "vtkObjectFactory.h"
#include "vtkPlaneCollection.h"
vtkCxxRevisionMacro(vtkClipPlanesPainter, "1.2");
vtkCxxRevisionMacro(vtkClipPlanesPainter, "1.3");
vtkCxxSetObjectMacro(vtkClipPlanesPainter, ClippingPlanes, vtkPlaneCollection);
// Needed when we don't use the vtkStandardNewMacro.
......@@ -42,7 +42,7 @@ vtkClipPlanesPainter::~vtkClipPlanesPainter()
vtkClipPlanesPainter* vtkClipPlanesPainter::New()
{
vtkObject* o = vtkGraphicsFactory::CreateInstance("vtkClipPlanesPainter");
return (vtkClipPlanesPainter*)o;
return static_cast<vtkClipPlanesPainter *>(o);
}
//-----------------------------------------------------------------------------
......
......@@ -25,7 +25,7 @@
// Needed when we don't use the vtkStandardNewMacro.
vtkInstantiatorNewMacro(vtkCoincidentTopologyResolutionPainter);
vtkCxxRevisionMacro(vtkCoincidentTopologyResolutionPainter, "1.3");
vtkCxxRevisionMacro(vtkCoincidentTopologyResolutionPainter, "1.4");
vtkInformationKeyMacro(vtkCoincidentTopologyResolutionPainter,
RESOLVE_COINCIDENT_TOPOLOGY, Integer);
vtkInformationKeyMacro(vtkCoincidentTopologyResolutionPainter, Z_SHIFT, Double);
......@@ -54,7 +54,7 @@ vtkCoincidentTopologyResolutionPainter::New()
{
vtkObject* o = vtkGraphicsFactory::CreateInstance(
"vtkCoincidentTopologyResolutionPainter");
return (vtkCoincidentTopologyResolutionPainter*)o;
return static_cast<vtkCoincidentTopologyResolutionPainter *>(o);
}
......
......@@ -22,7 +22,7 @@
// Needed when we don't use the vtkStandardNewMacro.
vtkInstantiatorNewMacro(vtkDisplayListPainter);
vtkCxxRevisionMacro(vtkDisplayListPainter, "1.2");
vtkCxxRevisionMacro(vtkDisplayListPainter, "1.3");
vtkInformationKeyMacro(vtkDisplayListPainter, IMMEDIATE_MODE_RENDERING, Integer);
//----------------------------------------------------------------------------
vtkDisplayListPainter::vtkDisplayListPainter()
......@@ -39,7 +39,7 @@ vtkDisplayListPainter::~vtkDisplayListPainter()
vtkDisplayListPainter* vtkDisplayListPainter::New()
{
vtkObject* o = vtkGraphicsFactory::CreateInstance("vtkDisplayListPainter");
return (vtkDisplayListPainter*)o;
return static_cast<vtkDisplayListPainter *>(o);
}
//----------------------------------------------------------------------------
......
......@@ -50,7 +50,7 @@ using vtksys_ios::ofstream;
# define SNPRINTF snprintf
#endif
vtkCxxRevisionMacro(vtkDynamic2DLabelMapper, "1.8");
vtkCxxRevisionMacro(vtkDynamic2DLabelMapper, "1.9");
vtkStandardNewMacro(vtkDynamic2DLabelMapper);
//----------------------------------------------------------------------------
......@@ -533,8 +533,8 @@ void vtkDynamic2DLabelMapper::RenderOpaqueGeometry(vtkViewport *viewport,
float* ptj = reinterpret_cast<float*>(pts->GetVoidPointer(3*indexJ));
float absX = (pti[0] - ptj[0]) > 0 ? (pti[0] - ptj[0]) : -(pti[0] - ptj[0]);
float absY = (pti[1] - ptj[1]) > 0 ? (pti[1] - ptj[1]) : -(pti[1] - ptj[1]);
float xScale = 2*absX/(float)(this->LabelWidth[indexI] + this->LabelWidth[indexJ]);
float yScale = 2*absY/(float)(this->LabelHeight[indexI] + this->LabelHeight[indexJ]);
float xScale = 2*absX/(this->LabelWidth[indexI] + this->LabelWidth[indexJ]);
float yScale = 2*absY/(this->LabelHeight[indexI] + this->LabelHeight[indexJ]);
float maxScale = xScale < yScale ? yScale : xScale;
if (maxScale < this->Cutoff[indexJ] && maxScale < this->Cutoff[indexI])
{
......
......@@ -16,7 +16,7 @@
#include "vtkRenderWindow.h"
vtkCxxRevisionMacro(vtkExporter, "1.19");
vtkCxxRevisionMacro(vtkExporter, "1.20");
vtkCxxSetObjectMacro(vtkExporter,RenderWindow,vtkRenderWindow);
......@@ -137,7 +137,8 @@ void vtkExporter::PrintSelf(ostream& os, vtkIndent indent)
if ( this->RenderWindow )
{
os << indent << "Render Window: (" << (void *)this->RenderWindow << ")\n";
os << indent << "Render Window: (" <<
static_cast<void *>(this->RenderWindow) << ")\n";
}
else
{
......@@ -146,7 +147,8 @@ void vtkExporter::PrintSelf(ostream& os, vtkIndent indent)
if ( this->StartWrite )
{
os << indent << "Start Write: (" << (void *)this->StartWrite << ")\n";
os << indent << "Start Write: (" <<
static_cast<void (*)(void *)>(this->StartWrite) << ")\n";
}
else
{
......@@ -155,7 +157,8 @@ void vtkExporter::PrintSelf(ostream& os, vtkIndent indent)
if ( this->EndWrite )
{
os << indent << "End Write: (" << (void *)this->EndWrite << ")\n";
os << indent << "End Write: (" <<
static_cast<void (*)(void *)>(this->EndWrite) << ")\n";
}
else
{
......
......@@ -39,7 +39,7 @@
#define VTK_FTFC_DEBUG_CD 0
//----------------------------------------------------------------------------
vtkCxxRevisionMacro(vtkFreeTypeUtilities, "1.28");
vtkCxxRevisionMacro(vtkFreeTypeUtilities, "1.29");
vtkInstantiatorNewMacro(vtkFreeTypeUtilities);
//----------------------------------------------------------------------------
......@@ -104,8 +104,8 @@ vtkFreeTypeUtilities* vtkFreeTypeUtilities::GetInstance()
{
if (!vtkFreeTypeUtilities::Instance)
{
vtkFreeTypeUtilities::Instance = (vtkFreeTypeUtilities*)
vtkObjectFactory::CreateInstance("vtkFreeTypeUtilities");
vtkFreeTypeUtilities::Instance = static_cast<vtkFreeTypeUtilities *>(
vtkObjectFactory::CreateInstance("vtkFreeTypeUtilities"));
if (!vtkFreeTypeUtilities::Instance)
{
vtkFreeTypeUtilities::Instance = new vtkFreeTypeUtilities;
......@@ -313,7 +313,7 @@ void vtkFreeTypeUtilities::MapIdToTextProperty(unsigned long id,
// - 1/10th degree: 12 bits (11.8)
int angle = id >> bits;
tprop->SetOrientation((float)(angle & ((1 << 12) - 1)) / 10.0);
tprop->SetOrientation((angle & ((1 << 12) - 1)) / 10.0);
// We really should not use more than 32 bits
}
......@@ -470,7 +470,7 @@ void vtkFreeTypeUtilities::InitializeCacheManager()
this->MaximumNumberOfSizes,
this->MaximumNumberOfBytes,
vtkFreeTypeUtilitiesFaceRequester,
(FT_Pointer)this,
static_cast<FT_Pointer>(this),
this->CacheManager);
if (error)
......@@ -911,8 +911,8 @@ int vtkFreeTypeUtilities::GetBoundingBox(vtkTextProperty *tprop,
newLineMovement[1] -= adjustedY;
newLineMovement[0] = floor(newLineMovement[0] + 0.5);
newLineMovement[1] = floor(newLineMovement[1] + 0.5);
x += (int)newLineMovement[0];
y += (int)newLineMovement[1];
x += static_cast<int>(newLineMovement[0]);
y += static_cast<int>(newLineMovement[1]);
originalX = x;
originalY = y;
//don't forget to start a new currentLine
......@@ -1150,8 +1150,8 @@ int vtkFreeTypeUtilities::PopulateImageData(vtkTextProperty *tprop,
newLineMovement[1] -= adjustedY;
newLineMovement[0] = floor(newLineMovement[0] + 0.5);
newLineMovement[1] = floor(newLineMovement[1] + 0.5);
x += (int)newLineMovement[0];
y += (int)newLineMovement[1];
x += static_cast<int>(newLineMovement[0]);
y += static_cast<int>(newLineMovement[1]);
originalX = x;
originalY = y;
//don't forget to start a new currentLine
......@@ -1235,7 +1235,7 @@ int vtkFreeTypeUtilities::PopulateImageData(vtkTextProperty *tprop,
// Render
unsigned char *data_ptr =
(unsigned char *)data->GetScalarPointer(pen_x, pen_y, 0);
static_cast<unsigned char *>(data->GetScalarPointer(pen_x, pen_y, 0));
if( !data_ptr )
{
return 0;
......@@ -1258,13 +1258,16 @@ int vtkFreeTypeUtilities::PopulateImageData(vtkTextProperty *tprop,
t_alpha = tprop_opacity * (*glyph_ptr / 255.0);
t_1_m_alpha = 1.0 - t_alpha;
data_alpha = (data_ptr[3] - data_min) / data_range;
*data_ptr = (unsigned char)(data_min + data_range * tprop_r);
*data_ptr = static_cast<unsigned char>(
data_min + data_range * tprop_r);
data_ptr++;
*data_ptr = (unsigned char)(data_min + data_range * tprop_g);
*data_ptr = static_cast<unsigned char>(
data_min + data_range * tprop_g);
data_ptr++;
*data_ptr = (unsigned char)(data_min + data_range * tprop_b);
*data_ptr = static_cast<unsigned char>(
data_min + data_range * tprop_b);
data_ptr++;
*data_ptr = (unsigned char)(
*data_ptr = static_cast<unsigned char>(
data_min + data_range * (t_alpha + data_alpha * t_1_m_alpha));
data_ptr++;
glyph_ptr++;
......@@ -1391,9 +1394,9 @@ void vtkFreeTypeUtilities::PrintEntry(int i, char *msg)
if (this->Entries[i]->Font)
{
printf(" [F: %p]", (void*)this->Entries[i]->Font);
printf(" [F: %p]", static_cast<void *>(this->Entries[i]->Font));
printf("\n [f: %p]",
(void*)*(this->Entries[i]->Font->Face()->Face()));
static_cast<void*>(*(this->Entries[i]->Font->Face()->Face())));
}
printf("\n");
......@@ -1749,14 +1752,14 @@ void vtkFreeTypeUtilities::GetWidthHeightDescender(const char *str,
{
//check the length of the line
*itr = '\0';
currstrlen = (int)font->Advance(currstr);
currstrlen = static_cast<int>(font->Advance(currstr));
//if its greater than our current length it becomes our new width
if(currstrlen > *width)
{
*width = currstrlen;
}
//increment height by the vertical size of the text
*height += (int)(entry->LargestAscender - entry->LargestDescender);
*height += static_cast<int>(entry->LargestAscender - entry->LargestDescender);
//and start a new current string
*currstr = '\0';
itr = currstr;
......@@ -1771,12 +1774,13 @@ void vtkFreeTypeUtilities::GetWidthHeightDescender(const char *str,
}
*itr = '\0';
currstrlen = (int)font->Advance(currstr);
currstrlen = static_cast<int>(font->Advance(currstr));
if(currstrlen > *width)
{
*width = currstrlen;
}
*height += (int)(entry->LargestAscender - entry->LargestDescender);
*height += static_cast<int>(
entry->LargestAscender - entry->LargestDescender);
*descender = entry->LargestDescender;
delete [] currstr;
}
......@@ -1817,8 +1821,8 @@ void vtkFreeTypeUtilities::PrepareImageData(vtkImageData *data,
if (img_dims[0] < text_size[0] || img_dims[1] < text_size[1] ||
text_size[0] * 2 < img_dims[0] || text_size[1] * 2 < img_dims[0])
{
new_img_dims[0] = 1 << (int)ceil(log((double)text_size[0]) / log(2.0));
new_img_dims[1] = 1 << (int)ceil(log((double)text_size[1]) / log(2.0));
new_img_dims[0] = 1 << static_cast<int>(ceil(log(static_cast<double>(text_size[0])) / log(2.0)));
new_img_dims[1] = 1 << static_cast<int>(ceil(log(static_cast<double>(text_size[1])) / log(2.0)));
// Ken is changing this to be a power of two and will look into the
// alignment issues that are raised below. Basically letting the tmap
......@@ -1878,8 +1882,8 @@ int vtkFreeTypeUtilities::GetConstrainedFontSize(const char *str,
int width = 0;
float notUsed = 0;
this->GetWidthHeightDescender(str, tprop, &width, &height, &notUsed);
size[0] = (double)width;
size[1] = (double)height;
size[0] = width;
size[1] = height;
transform->TransformPoint(size, size);
size[0] = floor(size[0] + 0.5);
size[1] = floor(size[1] + 0.5);
......@@ -1894,13 +1898,13 @@ int vtkFreeTypeUtilities::GetConstrainedFontSize(const char *str,
if (size[0] != 0 && size[1] != 0)
{
float fx = (float)targetWidth / (float)size[0];
float fy = (float)targetHeight / (float)size[1];
fontSize = (int)ceil((float)fontSize * ((fx <= fy) ? fx : fy));
double fx = targetWidth / size[0];
double fy = targetHeight / size[1];
fontSize = static_cast<int>(ceil(fontSize * ((fx <= fy) ? fx : fy)));
tprop->SetFontSize(fontSize);
this->GetWidthHeightDescender(str, tprop, &width, &height, &notUsed);
size[0] = (double)width;
size[1] = (double)height;
size[0] = width;
size[1] = height;
transform->TransformPoint(size, size);
size[0] = floor(size[0] + 0.5);
size[1] = floor(size[1] + 0.5);
......@@ -1914,8 +1918,8 @@ int vtkFreeTypeUtilities::GetConstrainedFontSize(const char *str,
fontSize++;
tprop->SetFontSize(fontSize);
this->GetWidthHeightDescender(str, tprop, &width, &height, &notUsed);
size[0] = (double)width;
size[1] = (double)height;
size[0] = width;
size[1] = height;
transform->TransformPoint(size, size);
size[0] = floor(size[0] + 0.5);
size[1] = floor(size[1] + 0.5);
......@@ -1928,8 +1932,8 @@ int vtkFreeTypeUtilities::GetConstrainedFontSize(const char *str,
fontSize--;
tprop->SetFontSize(fontSize);
this->GetWidthHeightDescender(str, tprop, &width, &height, &notUsed);
size[0] = (double)width;
size[1] = (double)height;
size[0] = width;
size[1] = height;
transform->TransformPoint(size, size);
size[0] = floor(size[0] + 0.5);
size[1] = floor(size[1] + 0.5);
......@@ -1975,9 +1979,9 @@ void vtkFreeTypeUtilities::JustifyLine(const char *str, vtkTextProperty *tprop,
transform->RotateZ(tprop->GetOrientation());
transform->TransformPoint(movement, movement);
movement[0] = floor(movement[0] + 0.5);
*x += (int)movement[0];
*x += static_cast<int>(movement[0]);
movement[1] = floor(movement[1] + 0.5);
*y += (int)movement[1];
*y += static_cast<int>(movement[1]);
lineFound = true;
}
break;
......@@ -2004,9 +2008,9 @@ void vtkFreeTypeUtilities::JustifyLine(const char *str, vtkTextProperty *tprop,
transform->RotateZ(tprop->GetOrientation());
transform->TransformPoint(movement, movement);
movement[0] = floor(movement[0] + 0.5);
*x += (int)movement[0];
*x += static_cast<int>(movement[0]);
movement[1] = floor(movement[1] + 0.5);
*y += (int)movement[1];
*y += static_cast<int>(movement[1]);
}
}
transform->Delete();
......
......@@ -20,7 +20,7 @@
#include "vtkProp.h"
#include "vtkRenderer.h"
vtkCxxRevisionMacro(vtkFrustumCoverageCuller, "1.33");
vtkCxxRevisionMacro(vtkFrustumCoverageCuller, "1.34");
vtkStandardNewMacro(vtkFrustumCoverageCuller);
// Create a frustum coverage culler with default values
......@@ -112,13 +112,12 @@ double vtkFrustumCoverageCuller::Cull( vtkRenderer *ren,
center[0] = (bounds[0] + bounds[1]) / 2.0;
center[1] = (bounds[2] + bounds[3]) / 2.0;
center[2] = (bounds[4] + bounds[5]) / 2.0;
radius = 0.5 * sqrt( (double)
( bounds[1] - bounds[0] ) *
( bounds[1] - bounds[0] ) +
( bounds[3] - bounds[2] ) *
( bounds[3] - bounds[2] ) +
( bounds[5] - bounds[4] ) *
( bounds[5] - bounds[4] ) );
radius = 0.5 * sqrt( ( bounds[1] - bounds[0] ) *
( bounds[1] - bounds[0] ) +
( bounds[3] - bounds[2] ) *
( bounds[3] - bounds[2] ) +
( bounds[5] - bounds[4] ) *
( bounds[5] - bounds[4] ) );
for ( i = 0; i < 6; i++ )
{
// Compute how far the center of the sphere is from this plane
......
......@@ -16,7 +16,7 @@
#include "vtkObjectFactory.h"
#include "vtkCommand.h"
vtkCxxRevisionMacro(vtkGenericRenderWindowInteractor, "1.10");
vtkCxxRevisionMacro(vtkGenericRenderWindowInteractor, "1.11");
vtkStandardNewMacro(vtkGenericRenderWindowInteractor);
//------------------------------------------------------------------
......@@ -169,7 +169,7 @@ void vtkGenericRenderWindowInteractor::TimerEvent()
}
int timerId = this->GetCurrentTimerId();
this->InvokeEvent(vtkCommand::TimerEvent, (void*)&timerId);
this->InvokeEvent(vtkCommand::TimerEvent, &timerId);
if (!this->IsOneShotTimer(timerId) &&
this->GetTimerEventResetsTimer())
......@@ -228,7 +228,7 @@ int vtkGenericRenderWindowInteractor::InternalCreateTimer(int timerId, int timer
this->SetTimerEventType(timerType);
this->SetTimerEventDuration(duration);
this->SetTimerEventPlatformId(timerId);
this->InvokeEvent(vtkCommand::CreateTimerEvent, (void*)&timerId);
this->InvokeEvent(vtkCommand::CreateTimerEvent, &timerId);
return this->GetTimerEventPlatformId();
}
return 0;
......@@ -240,7 +240,7 @@ int vtkGenericRenderWindowInteractor::InternalDestroyTimer(int platformTimerId)
if(this->HasObserver(vtkCommand::DestroyTimerEvent))
{
this->SetTimerEventPlatformId(platformTimerId);
this->InvokeEvent(vtkCommand::DestroyTimerEvent, (void*)&platformTimerId);
this->InvokeEvent(vtkCommand::DestroyTimerEvent, &platformTimerId);
return 1;
}
return 0;
......
......@@ -34,7 +34,7 @@
#include "vtkTransform.h"
#include "vtkUnsignedCharArray.h"
vtkCxxRevisionMacro(vtkIVExporter, "1.62");
vtkCxxRevisionMacro(vtkIVExporter, "1.63");
vtkStandardNewMacro(vtkIVExporter);
vtkIVExporter::vtkIVExporter()
......@@ -172,7 +172,7 @@ void vtkIVExporter::WriteData()
{
for (anActor->InitPathTraversal(); (apath=anActor->GetNextPath()); )
{
aPart=(vtkActor *)apath->GetLastNode()->GetViewProp();
aPart=static_cast<vtkActor *>(apath->GetLastNode()->GetViewProp());
this->WriteAnActor(aPart, fp);
}
}
......@@ -300,7 +300,7 @@ void vtkIVExporter::WriteAnActor(vtkActor *anActor, FILE *fp)
else
{
ds->Update();
pd = (vtkPolyData *)ds;
pd = static_cast<vtkPolyData *>(ds);
}
pm = vtkPolyDataMapper::New();
......@@ -461,7 +461,7 @@ void vtkIVExporter::WriteAnActor(vtkActor *anActor, FILE *fp)
for (i = 0; i < npts; i++)
{
// treating vtkIdType as int
fprintf(fp,"%i, ",(int)indx[i]);
fprintf(fp,"%i, ",static_cast<int>(indx[i]));
if (((i+1)%10) == 0)
{
fprintf(fp, "\n%s ", indent);
......@@ -489,7 +489,7 @@ void vtkIVExporter::WriteAnActor(vtkActor *anActor, FILE *fp)
for (i = 0; i < npts; i++)
{
// treating vtkIdType as int
fprintf(fp,"%i, ", (int)indx[i]);
fprintf(fp,"%i, ", static_cast<int>(indx[i]));
if (((i+1)%10) == 0)
{
fprintf(fp, "\n%s ", indent);
......@@ -517,7 +517,7 @@ void vtkIVExporter::WriteAnActor(vtkActor *anActor, FILE *fp)
for (i = 0; i < npts; i++)
{
// treating vtkIdType as int
fprintf(fp,"%i, ", (int)indx[i]);
fprintf(fp,"%i, ", static_cast<int>(indx[i]));
if (((i+1)%10) == 0)