Commit be0bb546 authored by Brad King's avatar Brad King

ENH: Another windows.h update. Methods that are mangled are now all...

ENH: Another windows.h update.  Methods that are mangled are now all deprecated (except GetClassName which will have its own pass later).  Those that were renamed to have internal protected names (like RemovePropInternal) have been renamed again to a new non-mangled public name (like RemoveViewProp).  After the VTK 5.0 release we can remove the mangled names altogether.
parent 0fe0a29c
......@@ -17,50 +17,28 @@
#include "vtkMatrix4x4.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkAssemblyNode, "1.7");
vtkCxxRevisionMacro(vtkAssemblyNode, "1.8");
vtkStandardNewMacro(vtkAssemblyNode);
vtkAssemblyNode::vtkAssemblyNode()
{
this->Prop = NULL;
this->ViewProp = NULL;
this->Matrix = NULL;
}
vtkAssemblyNode::~vtkAssemblyNode()
{
// if ( this->Prop )
// {
// this->Prop->Delete();
// }
if ( this->Matrix )
{
this->Matrix->Delete();
}
}
//----------------------------------------------------------------------------
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef SetProp
// Define possible mangled names.
void vtkAssemblyNode::SetPropA(vtkProp* prop)
{
this->SetPropInternal(prop);
}
void vtkAssemblyNode::SetPropW(vtkProp* prop)
{
this->SetPropInternal(prop);
}
#endif
void vtkAssemblyNode::SetProp(vtkProp* prop)
{
this->SetPropInternal(prop);
}
//----------------------------------------------------------------------------
// Don't do reference counting
void vtkAssemblyNode::SetPropInternal(vtkProp *prop)
void vtkAssemblyNode::SetViewProp(vtkProp *prop)
{
this->Prop = prop;
this->ViewProp = prop;
}
......@@ -89,9 +67,9 @@ unsigned long vtkAssemblyNode::GetMTime()
unsigned long propMTime=0;
unsigned long matrixMTime=0;
if ( this->Prop != NULL )
if ( this->ViewProp != NULL )
{
propMTime = this->Prop->GetMTime();
propMTime = this->ViewProp->GetMTime();
}
if ( this->Matrix != NULL )
{
......@@ -101,43 +79,17 @@ unsigned long vtkAssemblyNode::GetMTime()
return (propMTime > matrixMTime ? propMTime : matrixMTime);
}
//----------------------------------------------------------------------------
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef GetProp
// Define possible mangled names.
vtkProp* vtkAssemblyNode::GetPropA()
{
return this->GetPropInternal();
}
vtkProp* vtkAssemblyNode::GetPropW()
{
return this->GetPropInternal();
}
#endif
vtkProp* vtkAssemblyNode::GetProp()
{
return this->GetPropInternal();
}
//----------------------------------------------------------------------------
vtkProp* vtkAssemblyNode::GetPropInternal()
{
vtkDebugMacro(<< this->GetClassName() << " (" << this
<< "): returning Prop address " << this->Prop );
return this->Prop;
}
void vtkAssemblyNode::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
if ( this->Prop )
if ( this->ViewProp )
{
os << indent << "Prop: " << this->Prop << "\n";
os << indent << "ViewProp: " << this->ViewProp << "\n";
}
else
{
os << indent << "Prop: (none)\n";
os << indent << "ViewProp: (none)\n";
}
if ( this->Matrix )
......@@ -150,4 +102,46 @@ void vtkAssemblyNode::PrintSelf(ostream& os, vtkIndent indent)
}
}
//----------------------------------------------------------------------------
#ifndef VTK_LEGACY_REMOVE
# ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef SetProp
# undef GetProp
void const vtkAssemblyNode::SetPropA(vtkProp* prop)
{
VTK_LEGACY_REPLACED_BODY(vtkAssemblyNode::SetProp, "5.0",
vtkAssemblyNode::SetViewProp);
this->SetViewProp(prop);
}
void const vtkAssemblyNode::SetPropW(vtkProp* prop)
{
VTK_LEGACY_REPLACED_BODY(vtkAssemblyNode::SetProp, "5.0",
vtkAssemblyNode::SetViewProp);
this->SetViewProp(prop);
}
vtkProp* const vtkAssemblyNode::GetPropA()
{
VTK_LEGACY_REPLACED_BODY(vtkAssemblyNode::GetProp, "5.0",
vtkAssemblyNode::GetViewProp);
return this->GetViewProp();
}
vtkProp* const vtkAssemblyNode::GetPropW()
{
VTK_LEGACY_REPLACED_BODY(vtkAssemblyNode::GetProp, "5.0",
vtkAssemblyNode::GetViewProp);
return this->GetViewProp();
}
# endif
void const vtkAssemblyNode::SetProp(vtkProp* prop)
{
VTK_LEGACY_REPLACED_BODY(vtkAssemblyNode::SetProp, "5.0",
vtkAssemblyNode::SetViewProp);
this->SetViewProp(prop);
}
vtkProp* const vtkAssemblyNode::GetProp()
{
VTK_LEGACY_REPLACED_BODY(vtkAssemblyNode::GetProp, "5.0",
vtkAssemblyNode::GetViewProp);
return this->GetViewProp();
}
#endif
......@@ -57,8 +57,35 @@ public:
vtkTypeRevisionMacro(vtkAssemblyNode,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Set/Get the prop that this assembly node refers to.
virtual void SetViewProp(vtkProp* prop);
vtkGetObjectMacro(ViewProp, vtkProp);
// Description:
// Specify a transformation matrix associated with the prop.
// Note: if the prop is not a type of vtkProp3D, then the
// transformation matrix is ignored (and expected to be NULL).
// Also, internal to this object the matrix is copied because
// the matrix is used for computation by vtkAssemblyPath.
void SetMatrix(vtkMatrix4x4 *matrix);
vtkGetObjectMacro(Matrix, vtkMatrix4x4);
// Description:
// Override the standard GetMTime() to check for the modified times
// of the prop and matrix.
virtual unsigned long GetMTime();
// Disable warnings about qualifiers on return types.
#if defined(_COMPILER_VERSION)
# pragma set woff 3303
#endif
#if defined(__INTEL_COMPILER)
# pragma warning (push)
# pragma warning (disable:858)
#endif
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
// Avoid windows name mangling.
# define SetPropA SetProp
# define SetPropW SetProp
# define GetPropA GetProp
......@@ -66,9 +93,12 @@ public:
#endif
// Description:
// Set/Get the prop that this assembly node refers to.
void SetProp(vtkProp* prop);
vtkProp* GetProp();
// @deprecated Replaced by vtkAssemblyNode::SetViewProp() as of VTK 5.0.
VTK_LEGACY(virtual void const SetProp(vtkProp* prop));
// Description:
// @deprecated Replaced by vtkAssemblyNode::GetViewProp() as of VTK 5.0.
VTK_LEGACY(virtual vtkProp* const GetProp());
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef SetPropW
......@@ -76,36 +106,27 @@ public:
# undef GetPropW
# undef GetPropA
//BTX
// Define possible mangled names.
void SetPropA(vtkProp* prop);
void SetPropW(vtkProp* prop);
vtkProp* GetPropA();
vtkProp* GetPropW();
VTK_LEGACY(virtual void const SetPropA(vtkProp* prop));
VTK_LEGACY(virtual void const SetPropW(vtkProp* prop));
VTK_LEGACY(virtual vtkProp* const GetPropA());
VTK_LEGACY(virtual vtkProp* const GetPropW());
//ETX
#endif
// Description:
// Specify a transformation matrix associated with the prop.
// Note: if the prop is not a type of vtkProp3D, then the
// transformation matrix is ignored (and expected to be NULL).
// Also, internal to this object the matrix is copied because
// the matrix is used for computation by vtkAssemblyPath.
void SetMatrix(vtkMatrix4x4 *matrix);
vtkGetObjectMacro(Matrix, vtkMatrix4x4);
// Description:
// Override the standard GetMTime() to check for the modified times
// of the prop and matrix.
virtual unsigned long GetMTime();
// Reset disabled warning about qualifiers on return types.
#if defined(__INTEL_COMPILER)
# pragma warning (pop)
#endif
#if defined(_COMPILER_VERSION)
# pragma reset woff 3303
#endif
protected:
vtkAssemblyNode();
~vtkAssemblyNode();
void SetPropInternal(vtkProp* prop);
virtual vtkProp* GetPropInternal();
private:
vtkProp *Prop; //reference to vtkProp
vtkProp *ViewProp; //reference to vtkProp
vtkMatrix4x4 *Matrix; //associated matrix
private:
......
......@@ -19,7 +19,7 @@
#include "vtkObjectFactory.h"
#include "vtkProp.h"
vtkCxxRevisionMacro(vtkAssemblyPath, "1.7");
vtkCxxRevisionMacro(vtkAssemblyPath, "1.8");
vtkStandardNewMacro(vtkAssemblyPath);
vtkAssemblyPath::vtkAssemblyPath()
......@@ -41,7 +41,7 @@ vtkAssemblyPath::~vtkAssemblyPath()
void vtkAssemblyPath::AddNode(vtkProp *p, vtkMatrix4x4 *m)
{
vtkAssemblyNode *n = vtkAssemblyNode::New();
n->SetProp(p);
n->SetViewProp(p);
n->SetMatrix(m); //really a copy because we're gonna compute with it
this->AddNode(n);
n->Delete(); //ok reference counted
......
......@@ -16,7 +16,7 @@
#include "vtkObjectFactory.h"
#include "vtkCollection.h"
vtkCxxRevisionMacro(vtkCollectionIterator, "1.3");
vtkCxxRevisionMacro(vtkCollectionIterator, "1.4");
vtkStandardNewMacro(vtkCollectionIterator);
//----------------------------------------------------------------------------
......@@ -82,29 +82,36 @@ int vtkCollectionIterator::IsDoneWithTraversal()
}
//----------------------------------------------------------------------------
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef GetObject
// Define possible mangled names.
vtkObject* vtkCollectionIterator::GetCurrentObject()
{
if(this->Element)
{
return this->Element->Item;
}
return 0;
}
//----------------------------------------------------------------------------
#ifndef VTK_LEGACY_REMOVE
# ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef GetObject
vtkObject* vtkCollectionIterator::GetObjectA()
{
return this->GetObjectInternal();
VTK_LEGACY_REPLACED_BODY(vtkCollectionIterator::GetObject, "5.0",
vtkCollectionIterator::GetCurrentObject);
return this->GetCurrentObject();
}
vtkObject* vtkCollectionIterator::GetObjectW()
{
return this->GetObjectInternal();
VTK_LEGACY_REPLACED_BODY(vtkCollectionIterator::GetObject, "5.0",
vtkCollectionIterator::GetCurrentObject);
return this->GetCurrentObject();
}
#endif
# endif
vtkObject* vtkCollectionIterator::GetObject()
{
return this->GetObjectInternal();
}
//----------------------------------------------------------------------------
vtkObject* vtkCollectionIterator::GetObjectInternal()
{
if(this->Element)
{
return this->Element->Item;
}
return 0;
VTK_LEGACY_REPLACED_BODY(vtkCollectionIterator::GetObject, "5.0",
vtkCollectionIterator::GetCurrentObject);
return this->GetCurrentObject();
}
#endif
......@@ -59,24 +59,27 @@ public:
// Returns 1 for yes, 0 for no.
int IsDoneWithTraversal();
// Description:
// Get the item at the current iterator position. Valid only when
// IsDoneWithTraversal() returns 1.
vtkObject* GetCurrentObject();
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
// Avoid windows name mangling.
# define GetObjectA GetObject
# define GetObjectW GetObject
#endif
// Description:
// Get the item at the current iterator position. Valid only when
// IsDoneWithTraversal() returns 1.
vtkObject* GetObject();
// @deprecated Replaced by vtkCollectionIterator::GetCurrentObject() as
// of VTK 5.0.
VTK_LEGACY(vtkObject* GetObject());
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef GetObjectW
# undef GetObjectA
//BTX
// Define possible mangled names.
vtkObject* GetObjectA();
vtkObject* GetObjectW();
VTK_LEGACY(vtkObject* GetObjectA());
VTK_LEGACY(vtkObject* GetObjectW());
//ETX
#endif
......
......@@ -17,7 +17,7 @@
#include "vtkDataArray.h"
#include "vtkDataArrayCollection.h"
vtkCxxRevisionMacro(vtkDataArrayCollectionIterator, "1.2");
vtkCxxRevisionMacro(vtkDataArrayCollectionIterator, "1.3");
vtkStandardNewMacro(vtkDataArrayCollectionIterator);
//----------------------------------------------------------------------------
......@@ -63,5 +63,5 @@ void vtkDataArrayCollectionIterator::SetCollection(vtkDataArrayCollection* c)
//----------------------------------------------------------------------------
vtkDataArray* vtkDataArrayCollectionIterator::GetDataArray()
{
return static_cast<vtkDataArray*>(this->GetObject());
return static_cast<vtkDataArray*>(this->GetCurrentObject());
}
......@@ -18,7 +18,7 @@
#include <sys/stat.h>
vtkCxxRevisionMacro(vtkDirectory, "1.24");
vtkCxxRevisionMacro(vtkDirectory, "1.25");
//----------------------------------------------------------------------------
// Needed when we don't use the vtkStandardNewMacro.
......@@ -214,25 +214,7 @@ const char* vtkDirectory::GetCurrentWorkingDirectory(char* buf,
#endif
//----------------------------------------------------------------------------
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef CreateDirectory
// Define possible mangled names.
int vtkDirectory::CreateDirectoryA(const char* dir)
{
return vtkDirectory::CreateDirectoryInternal(dir);
}
int vtkDirectory::CreateDirectoryW(const char* dir)
{
return vtkDirectory::CreateDirectoryInternal(dir);
}
#endif
int vtkDirectory::CreateDirectory(const char* dir)
{
return vtkDirectory::CreateDirectoryInternal(dir);
}
//----------------------------------------------------------------------------
int vtkDirectory::CreateDirectoryInternal(const char* dir)
int vtkDirectory::MakeDirectory(const char* dir)
{
#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) \
|| defined(__MINGW32__))
......@@ -253,3 +235,28 @@ const char* vtkDirectory::GetFile(int index)
return this->Files[index];
}
//----------------------------------------------------------------------------
#ifndef VTK_LEGACY_REMOVE
# ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef CreateDirectory
int vtkDirectory::CreateDirectoryA(const char* dir)
{
VTK_LEGACY_REPLACED_BODY(vtkDirectory::CreateDirectory, "5.0",
vtkDirectory::MakeDirectory);
return vtkDirectory::MakeDirectory(dir);
}
int vtkDirectory::CreateDirectoryW(const char* dir)
{
VTK_LEGACY_REPLACED_BODY(vtkDirectory::CreateDirectory, "5.0",
vtkDirectory::MakeDirectory);
return vtkDirectory::MakeDirectory(dir);
}
# endif
int vtkDirectory::CreateDirectory(const char* dir)
{
VTK_LEGACY_REPLACED_BODY(vtkDirectory::CreateDirectory, "5.0",
vtkDirectory::MakeDirectory);
return vtkDirectory::MakeDirectory(dir);
}
#endif
......@@ -60,24 +60,26 @@ public:
// Get the current working directory.
static const char* GetCurrentWorkingDirectory(char* buf, unsigned int len);
// Description:
// Create directory. Needs rework to do all the testing and to work
// on all platforms.
static int MakeDirectory(const char* dir);
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
// Avoid windows name mangling.
# define CreateDirectoryA CreateDirectory
# define CreateDirectoryW CreateDirectory
#endif
// Description:
// Create directory. Needs rework to do all the testing and to work
// on all platforms.
static int CreateDirectory(const char* dir);
// @deprecated Replaced by vtkDirectory::MakeDirectory() as of VTK 5.0.
VTK_LEGACY(static int CreateDirectory(const char* dir));
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef CreateDirectoryW
# undef CreateDirectoryA
//BTX
// Define possible mangled names.
static int CreateDirectoryA(const char* dir);
static int CreateDirectoryW(const char* dir);
VTK_LEGACY(static int CreateDirectoryA(const char* dir));
VTK_LEGACY(static int CreateDirectoryW(const char* dir));
//ETX
#endif
......
......@@ -20,7 +20,7 @@
# include "vtkWindows.h"
#endif
vtkCxxRevisionMacro(vtkThreadMessager, "1.2");
vtkCxxRevisionMacro(vtkThreadMessager, "1.3");
vtkStandardNewMacro(vtkThreadMessager);
vtkThreadMessager::vtkThreadMessager()
......@@ -55,25 +55,7 @@ void vtkThreadMessager::WaitForMessage()
}
//----------------------------------------------------------------------------
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef SendMessage
// Define possible mangled names.
void vtkThreadMessager::SendMessageA()
{
this->SendMessageInternal();
}
void vtkThreadMessager::SendMessageW()
{
this->SendMessageInternal();
}
#endif
void vtkThreadMessager::SendMessage()
{
this->SendMessageInternal();
}
//----------------------------------------------------------------------------
void vtkThreadMessager::SendMessageInternal()
void vtkThreadMessager::SendWakeMessage()
{
#ifdef VTK_USE_WIN32_THREADS
SetEvent( this->WSignal );
......@@ -107,3 +89,28 @@ void vtkThreadMessager::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}
//----------------------------------------------------------------------------
#ifndef VTK_LEGACY_REMOVE
# ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef SendMessage
void vtkThreadMessager::SendMessageA()
{
VTK_LEGACY_REPLACED_BODY(vtkThreadMessager::SendMessage, "5.0",
vtkThreadMessager::SendWakeMessage);
this->SendWakeMessage();
}
void vtkThreadMessager::SendMessageW()
{
VTK_LEGACY_REPLACED_BODY(vtkThreadMessager::SendMessage, "5.0",
vtkThreadMessager::SendWakeMessage);
this->SendWakeMessage();
}
# endif
void vtkThreadMessager::SendMessage()
{
VTK_LEGACY_REPLACED_BODY(vtkThreadMessager::SendMessage, "5.0",
vtkThreadMessager::SendWakeMessage);
this->SendWakeMessage();
}
#endif
......@@ -39,26 +39,10 @@ public:
// message.
void WaitForMessage();
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
// Avoid windows name mangling.
# define SendMessageA SendMessage
# define SendMessageW SendMessage
#endif
// Description:
// Send a message to all threads who are waiting via
// WaitForMessage().
void SendMessage();
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef SendMessageW
# undef SendMessageA
//BTX
// Define possible mangled names.
void SendMessageA();
void SendMessageW();
//ETX
#endif
void SendWakeMessage();
// Description:
// pthreads only. If the wait is enabled, the thread who
......@@ -78,12 +62,29 @@ public:
// to receive a message.
void WaitForReceiver();
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# define SendMessageA SendMessage
# define SendMessageW SendMessage
#endif
// Description:
// @deprecated Replaced by vtkThreadMessager::SendWakeMessage() as of
// VTK 5.0.
VTK_LEGACY(void SendMessage());
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef SendMessageW
# undef SendMessageA
//BTX
VTK_LEGACY(void SendMessageA());
VTK_LEGACY(void SendMessageW());
//ETX
#endif
protected:
vtkThreadMessager();
~vtkThreadMessager();
void SendMessageInternal();
#ifdef VTK_USE_PTHREADS
pthread_mutex_t Mutex;
pthread_cond_t PSignal;
......
......@@ -38,7 +38,7 @@
#endif
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkTimerLog, "1.40");
vtkCxxRevisionMacro(vtkTimerLog, "1.41");
vtkStandardNewMacro(vtkTimerLog);
// initialze the class variables
......@@ -510,20 +510,10 @@ void vtkTimerLog::PrintSelf(ostream& os, vtkIndent indent)
// Methods to support simple timer functionality, separate from
// timer table logging.
//----------------------------------------------------------------------------
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef GetCurrentTime
// Define possible mangled names.
double vtkTimerLog::GetTickCount()
{
return vtkTimerLog::GetCurrentTime();
}
#endif
//----------------------------------------------------------------------------
// Returns the elapsed number of seconds since January 1, 1970. This
// is also called Universal Coordinated Time.
double vtkTimerLog::GetCurrentTime()
double vtkTimerLog::GetUniversalTime()
{
double currentTimeInSeconds;
......@@ -566,14 +556,14 @@ double vtkTimerLog::GetCPUTime()
// Set the StartTime to the current time. Used with GetElapsedTime().
void vtkTimerLog::StartTimer()
{
this->StartTime = vtkTimerLog::GetCurrentTime();
this->StartTime = vtkTimerLog::GetUniversalTime();
}
//----------------------------------------------------------------------------
// Sets EndTime to the current time. Used with GetElapsedTime().
void vtkTimerLog::StopTimer()
{
this->EndTime = vtkTimerLog::GetCurrentTime();
this->EndTime = vtkTimerLog::GetUniversalTime();
}
//----------------------------------------------------------------------------
......@@ -653,3 +643,21 @@ int vtkTimerLog::GetMaxEntries()
return vtkTimerLog::MaxEntries;
}
//----------------------------------------------------------------------------
#ifndef VTK_LEGACY_REMOVE
# ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef GetCurrentTime
double vtkTimerLog::GetTickCount()
{
VTK_LEGACY_REPLACED_BODY(vtkTimerLog::GetCurrentTime, "5.0",
vtkTimerLog::GetUniversalTime);
return vtkTimerLog::GetUniversalTime();
}
# endif
double vtkTimerLog::GetCurrentTime()
{
VTK_LEGACY_REPLACED_BODY(vtkTimerLog::GetCurrentTime, "5.0",
vtkTimerLog::GetUniversalTime);
return vtkTimerLog::GetUniversalTime();
}
#endif
......@@ -138,23 +138,10 @@ public:
// Remove timer log.
static void CleanupLog();
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
// Avoid windows name mangling.
# define GetTickCount GetCurrentTime
#endif
// Description:
// Returns the elapsed number of seconds since January 1, 1970. This
// is also called Universal Coordinated Time.
static double GetCurrentTime();
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# undef GetTickCount
//BTX
// Define possible mangled names.
static double GetTickCount();
//ETX
#endif
static double GetUniversalTime();
// Description:
// Returns the CPU time for this process
......@@ -174,6 +161,21 @@ public:
// a doubleing point value indicating the elapsed time in seconds.
double GetElapsedTime();
#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
# define GetTickCount GetCurrentTime