Commit 3e9afd55 authored by Brian Wylie's avatar Brian Wylie
Browse files

ENH: Switching out srand with vtkMath::RandomSeed

parent d4a8bd63
......@@ -37,7 +37,7 @@
#include "vtkFastSplatter.h"
#include "vtkImageData.h"
vtkCxxRevisionMacro(vtkClustering2DLayoutStrategy, "1.9");
vtkCxxRevisionMacro(vtkClustering2DLayoutStrategy, "1.10");
vtkStandardNewMacro(vtkClustering2DLayoutStrategy);
// This is just a convenient macro for smart pointers
......@@ -159,7 +159,7 @@ void vtkClustering2DLayoutStrategy::GenerateGaussianSplat(vtkImageData *splat, i
// Set the graph that will be laid out
void vtkClustering2DLayoutStrategy::Initialize()
{
srand(this->RandomSeed);
vtkMath::RandomSeed(this->RandomSeed);
// Set up some quick access variables
vtkPoints* pts = this->Graph->GetPoints();
......
......@@ -38,7 +38,7 @@
#include "vtkFastSplatter.h"
#include "vtkImageData.h"
vtkCxxRevisionMacro(vtkCommunity2DLayoutStrategy, "1.5");
vtkCxxRevisionMacro(vtkCommunity2DLayoutStrategy, "1.6");
vtkStandardNewMacro(vtkCommunity2DLayoutStrategy);
// This is just a convenient macro for smart pointers
......@@ -159,7 +159,7 @@ void vtkCommunity2DLayoutStrategy::GenerateGaussianSplat(vtkImageData *splat, in
// Set the graph that will be laid out
void vtkCommunity2DLayoutStrategy::Initialize()
{
srand(this->RandomSeed);
vtkMath::RandomSeed(this->RandomSeed);
// Set up some quick access variables
vtkPoints* pts = this->Graph->GetPoints();
......
......@@ -38,7 +38,7 @@
#include "vtkFastSplatter.h"
#include "vtkImageData.h"
vtkCxxRevisionMacro(vtkConstrained2DLayoutStrategy, "1.1");
vtkCxxRevisionMacro(vtkConstrained2DLayoutStrategy, "1.2");
vtkStandardNewMacro(vtkConstrained2DLayoutStrategy);
// This is just a convenient macro for smart pointers
......@@ -163,7 +163,7 @@ void vtkConstrained2DLayoutStrategy::GenerateGaussianSplat(vtkImageData *splat,
// Set the graph that will be laid out
void vtkConstrained2DLayoutStrategy::Initialize()
{
srand(this->RandomSeed);
vtkMath::RandomSeed(this->RandomSeed);
// Set up some quick access variables
vtkPoints* pts = this->Graph->GetPoints();
......
......@@ -37,7 +37,7 @@
#include "vtkFastSplatter.h"
#include "vtkImageData.h"
vtkCxxRevisionMacro(vtkFast2DLayoutStrategy, "1.15");
vtkCxxRevisionMacro(vtkFast2DLayoutStrategy, "1.16");
vtkStandardNewMacro(vtkFast2DLayoutStrategy);
// This is just a convenient macro for smart pointers
......@@ -158,7 +158,7 @@ void vtkFast2DLayoutStrategy::GenerateGaussianSplat(vtkImageData *splat, int x,
// Set the graph that will be laid out
void vtkFast2DLayoutStrategy::Initialize()
{
srand(this->RandomSeed);
vtkMath::RandomSeed(this->RandomSeed);
// Set up some quick access variables
vtkPoints* pts = this->Graph->GetPoints();
......
......@@ -31,7 +31,7 @@
#include "vtkTree.h"
vtkCxxRevisionMacro(vtkForceDirectedLayoutStrategy, "1.5");
vtkCxxRevisionMacro(vtkForceDirectedLayoutStrategy, "1.6");
vtkStandardNewMacro(vtkForceDirectedLayoutStrategy);
vtkForceDirectedLayoutStrategy::vtkForceDirectedLayoutStrategy()
......@@ -117,7 +117,7 @@ void vtkForceDirectedLayoutStrategy::Initialize()
// Get the points, either x,y,0 or x,y,z or random
if (this->RandomInitialPoints)
{
srand(this->RandomSeed);
vtkMath::RandomSeed(this->RandomSeed);
for (vtkIdType i = 0; i < numVertices; i++)
{
......
......@@ -31,7 +31,7 @@
#include "vtkTree.h"
vtkCxxRevisionMacro(vtkRandomLayoutStrategy, "1.5");
vtkCxxRevisionMacro(vtkRandomLayoutStrategy, "1.6");
vtkStandardNewMacro(vtkRandomLayoutStrategy);
vtkRandomLayoutStrategy::vtkRandomLayoutStrategy()
......@@ -74,7 +74,7 @@ void vtkRandomLayoutStrategy::SetGraph(vtkAbstractGraph *graph)
}
// Generate the points, either x,y,0 or x,y,z
srand(this->RandomSeed);
vtkMath::RandomSeed(this->RandomSeed);
vtkPoints* newPoints = vtkPoints::New();
for (int i=0; i< graph->GetNumberOfVertices(); i++)
......
......@@ -36,7 +36,7 @@
#include "vtkTree.h"
vtkCxxRevisionMacro(vtkSimple2DLayoutStrategy, "1.19");
vtkCxxRevisionMacro(vtkSimple2DLayoutStrategy, "1.20");
vtkStandardNewMacro(vtkSimple2DLayoutStrategy);
#ifndef MIN
......@@ -86,7 +86,7 @@ vtkSimple2DLayoutStrategy::~vtkSimple2DLayoutStrategy()
// Set the graph that will be laid out
void vtkSimple2DLayoutStrategy::Initialize()
{
srand(this->RandomSeed);
vtkMath::RandomSeed(this->RandomSeed);
// Set up some quick access variables
vtkPoints* pts = this->Graph->GetPoints();
......
Supports Markdown
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