Commit c41f0cdd authored by Rusty Blue's avatar Rusty Blue

ENH: SCALAR_TYPE and SCALAR_NUMBER_OF_COMPONENTS removed from the information...

ENH: SCALAR_TYPE and SCALAR_NUMBER_OF_COMPONENTS removed from the information object... now implemented within the FieldData related fields.
parent 21f9ab97
......@@ -29,8 +29,10 @@ PURPOSE. See the above copyright notice for more information.
#include "vtkInformationIntegerVectorKey.h"
#include "vtkInformationInformationVectorKey.h"
#include "vtkInformationStringKey.h"
#include "vtkInformationVector.h"
#include "vtkDataSetAttributes.h"
vtkCxxRevisionMacro(vtkDataObject, "1.16");
vtkCxxRevisionMacro(vtkDataObject, "1.17");
vtkStandardNewMacro(vtkDataObject);
vtkCxxSetObjectMacro(vtkDataObject,Information,vtkInformation);
......@@ -42,12 +44,12 @@ vtkInformationKeyMacro(vtkDataObject, DATA_EXTENT_TYPE, Integer);
vtkInformationKeyMacro(vtkDataObject, DATA_PIECE_NUMBER, Integer);
vtkInformationKeyMacro(vtkDataObject, DATA_NUMBER_OF_PIECES, Integer);
vtkInformationKeyMacro(vtkDataObject, DATA_NUMBER_OF_GHOST_LEVELS, Integer);
vtkInformationKeyMacro(vtkDataObject, SCALAR_TYPE, Integer);
vtkInformationKeyMacro(vtkDataObject, SCALAR_NUMBER_OF_COMPONENTS, Integer);
vtkInformationKeyMacro(vtkDataObject, FIELD_DATA_VECTOR, InformationVector);
vtkInformationKeyMacro(vtkDataObject, POINT_DATA_VECTOR, InformationVector);
vtkInformationKeyMacro(vtkDataObject, CELL_DATA_VECTOR, InformationVector);
vtkInformationKeyMacro(vtkDataObject, FIELD_ARRAY_TYPE, Integer);
vtkInformationKeyMacro(vtkDataObject, FIELD_ASSOCIATION, Integer);
vtkInformationKeyMacro(vtkDataObject, FIELD_ATTRIBUTE_TYPE, Integer);
vtkInformationKeyMacro(vtkDataObject, FIELD_ACTIVE_ATTRIBUTE, Integer);
vtkInformationKeyMacro(vtkDataObject, FIELD_NAME, String);
vtkInformationKeyMacro(vtkDataObject, FIELD_NUMBER_OF_COMPONENTS, Integer);
vtkInformationKeyMacro(vtkDataObject, FIELD_NUMBER_OF_TUPLES, Integer);
......@@ -350,9 +352,27 @@ void vtkDataObject::SetGlobalReleaseDataFlag(int val)
}
//----------------------------------------------------------------------------
void vtkDataObject::CopyInformationToPipeline(vtkInformation*, vtkInformation*)
void vtkDataObject::CopyInformationToPipeline(vtkInformation *request,
vtkInformation *input)
{
// Copy nothing by default.
// Set default pipeline information during a request for information.
if(request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION()))
{
// Copy point and cell data from the input if available. Otherwise use our
// current settings.
vtkInformation* output = this->PipelineInformation;
// copy point data.
if (input && input->Has(POINT_DATA_VECTOR()))
{
output->CopyEntry(input, POINT_DATA_VECTOR(), 1);
}
// copy cell data.
if (input && input->Has(CELL_DATA_VECTOR()))
{
output->CopyEntry(input, CELL_DATA_VECTOR(), 1);
}
}
}
//----------------------------------------------------------------------------
......@@ -361,6 +381,167 @@ void vtkDataObject::CopyInformationFromPipeline(vtkInformation*)
// Copy nothing by default.
}
//----------------------------------------------------------------------------
vtkInformation *vtkDataObject::GetActiveFieldInformation(vtkInformation *info,
int fieldAssociation, int attributeType)
{
int i;
vtkInformation *fieldDataInfo;
vtkInformationVector *fieldDataInfoVector;
if (fieldAssociation == FIELD_ASSOCIATION_POINTS)
{
fieldDataInfoVector = info->Get(POINT_DATA_VECTOR());
}
else if (fieldAssociation == FIELD_ASSOCIATION_CELLS)
{
fieldDataInfoVector = info->Get(CELL_DATA_VECTOR());
}
else
{
vtkGenericWarningMacro("Unrecognized field association!");
return NULL;
}
if (!fieldDataInfoVector)
{
return NULL;
}
for (i = 0; i < fieldDataInfoVector->GetNumberOfInformationObjects(); i++)
{
fieldDataInfo = fieldDataInfoVector->GetInformationObject(i);
if ( fieldDataInfo->Has(FIELD_ACTIVE_ATTRIBUTE()) &&
(fieldDataInfo->Get(FIELD_ACTIVE_ATTRIBUTE()) & (1 << attributeType )) )
{
return fieldDataInfo;
}
}
return NULL;
}
//----------------------------------------------------------------------------
vtkInformation *vtkDataObject::SetActiveAttribute(vtkInformation *info,
int fieldAssociation,
const char *attributeName,
int attributeType)
{
int i;
vtkInformation *fieldDataInfo;
vtkInformationVector *fieldDataInfoVector;
if (fieldAssociation == FIELD_ASSOCIATION_POINTS)
{
fieldDataInfoVector = info->Get(POINT_DATA_VECTOR());
}
else if (fieldAssociation == FIELD_ASSOCIATION_CELLS)
{
fieldDataInfoVector = info->Get(CELL_DATA_VECTOR());
}
else
{
vtkGenericWarningMacro("Unrecognized field association!");
return NULL;
}
if (!fieldDataInfoVector)
{
fieldDataInfoVector = vtkInformationVector::New();
if (fieldAssociation == FIELD_ASSOCIATION_POINTS)
{
info->Set(POINT_DATA_VECTOR(), fieldDataInfoVector);
}
else // (fieldAssociation == FIELD_ASSOCIATION_CELLS)
{
info->Set(CELL_DATA_VECTOR(), fieldDataInfoVector);
}
fieldDataInfoVector->Delete();
}
// if we find a matching field, turn it on (active); if another field of same
// attribute type was active, turn it off (not active)
vtkInformation *activeField = NULL;
int activeAttribute;
const char *fieldName;
for (i = 0; i < fieldDataInfoVector->GetNumberOfInformationObjects(); i++)
{
fieldDataInfo = fieldDataInfoVector->GetInformationObject(i);
activeAttribute = fieldDataInfo->Get( FIELD_ACTIVE_ATTRIBUTE() );
fieldName = fieldDataInfo->Get(FIELD_NAME());
// if names match (or both empty... no field name), then set active
if ( (attributeName && fieldName && !strcmp(attributeName, fieldName)) ||
(!attributeName && !fieldName) )
{
activeAttribute |= 1 << attributeType;
fieldDataInfo->Set( FIELD_ACTIVE_ATTRIBUTE(), activeAttribute );
activeField = fieldDataInfo;
}
else if ( activeAttribute & (1 << attributeType) )
{
activeAttribute &= ~(1 << attributeType);
fieldDataInfo->Set( FIELD_ACTIVE_ATTRIBUTE(), activeAttribute );
}
}
// if we didn't find a matching field, create one
if (!activeField)
{
activeField = vtkInformation::New();
activeField->Set( FIELD_ACTIVE_ATTRIBUTE(), 1 << attributeType);
activeField->Set(FIELD_ASSOCIATION(), fieldAssociation);
if (attributeName)
{
activeField->Set( FIELD_NAME(), attributeName );
}
fieldDataInfoVector->Append(activeField);
activeField->Delete();
}
return activeField;
}
//----------------------------------------------------------------------------
void vtkDataObject::SetActiveAttributeInfo(vtkInformation *info,
int fieldAssociation,
int attributeType,
const char *name,
int arrayType,
int numComponents,
int numTuples)
{
vtkInformation *attrInfo = vtkDataObject::GetActiveFieldInformation(info,
fieldAssociation, attributeType);
if (!attrInfo)
{
// create an entry and set it as active
attrInfo = SetActiveAttribute(info, fieldAssociation, name, attributeType);
}
if (name)
{
attrInfo->Set(FIELD_NAME(), name);
}
if (arrayType != -1)
{
attrInfo->Set(FIELD_ARRAY_TYPE(), arrayType);
}
if (numComponents != -1)
{
attrInfo->Set(FIELD_NUMBER_OF_COMPONENTS(), numComponents);
}
if (numTuples != -1)
{
attrInfo->Set(FIELD_NUMBER_OF_TUPLES(), numTuples);
}
}
//----------------------------------------------------------------------------
void vtkDataObject::SetPointDataActiveScalarInfo(vtkInformation *info,
int arrayType, int numComponents)
{
vtkDataObject::SetActiveAttributeInfo(info, FIELD_ASSOCIATION_POINTS,
vtkDataSetAttributes::SCALARS, NULL, arrayType, numComponents, -1);
}
//----------------------------------------------------------------------------
void vtkDataObject::DataHasBeenGenerated()
{
......
......@@ -315,6 +315,40 @@ public:
// PipelineInformation to its own Information for the given request.
virtual void CopyInformationFromPipeline(vtkInformation* request);
// Description:
// Return the information object within the input information object's
// field data corresponding to the specified association
// (FIELD_ASSOCIATION_POINTS or FIELD_ASSOCIATION_CELLS) and attribute
// (SCALARS, VECTORS, NORMALS, TCOORDS, or TENSORS)
static vtkInformation *GetActiveFieldInformation(vtkInformation *info,
int fieldAssociation, int attributeType);
// Description:
// Set the named array to be the active field for the specified type
// (SCALARS, VECTORS, NORMALS, TCOORDS, or TENSORS) and association
// (FIELD_ASSOCIATION_POINTS or FIELD_ASSOCIATION_CELLS). Returns the
// active field information object and creates on entry if one not found.
static vtkInformation *SetActiveAttribute(vtkInformation *info,
int fieldAssociation, const char *attributeName, int attributeType);
// Description:
// Set the name, array type, number of components, and number of tuples
// within the passed information object for the active attribute of type
// attributeType (in specified association, FIELD_ASSOCIATION_POINTS or
// FIELD_ASSOCIATION_CELLS). If there is not an active attribute of the
// specified type, an entry in the information object is created. If
// arrayType, numComponents, or numTuples equal to -1, or name=NULL the
// value is not changed.
static void SetActiveAttributeInfo(vtkInformation *info,
int fieldAssociation, int attributeType, const char *name, int arrayType,
int numComponents, int numTuples);
// Description:
// Convenience version of previous method for use (primarily) by the Imaging
// filters. If arrayType or numComponents == -1, the value is not changed.
static void SetPointDataActiveScalarInfo(vtkInformation *info,
int arrayType, int numComponents);
// Description:
// This method is called by the source when it executes to generate data.
// It is sort of the opposite of ReleaseData.
......@@ -382,12 +416,12 @@ public:
static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
static vtkInformationIntegerKey* SCALAR_TYPE();
static vtkInformationIntegerKey* SCALAR_NUMBER_OF_COMPONENTS();
static vtkInformationInformationVectorKey* FIELD_DATA_VECTOR();
static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
static vtkInformationIntegerKey* FIELD_ASSOCIATION();
static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
static vtkInformationIntegerKey* FIELD_OPERATION();
......
......@@ -40,8 +40,9 @@
#include "vtkUnsignedShortArray.h"
#include "vtkVertex.h"
#include "vtkVoxel.h"
#include "vtkInformationVector.h"
vtkCxxRevisionMacro(vtkImageData, "1.7");
vtkCxxRevisionMacro(vtkImageData, "1.8");
vtkStandardNewMacro(vtkImageData);
//----------------------------------------------------------------------------
......@@ -100,8 +101,16 @@ void vtkImageData::CopyStructure(vtkDataSet *ds)
vtkInformation* thatPInfo = ds->GetPipelineInformation();
if(thisPInfo && thatPInfo)
{
thisPInfo->CopyEntry(thatPInfo, vtkDataObject::SCALAR_TYPE());
thisPInfo->CopyEntry(thatPInfo, vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS());
// copy point data.
if (thatPInfo->Has(POINT_DATA_VECTOR()))
{
thisPInfo->CopyEntry(thatPInfo, POINT_DATA_VECTOR());
}
// copy cell data.
if (thatPInfo->Has(CELL_DATA_VECTOR()))
{
thisPInfo->CopyEntry(thatPInfo, CELL_DATA_VECTOR());
}
}
this->DataDescription = sPts->DataDescription;
this->CopyInformation(sPts);
......@@ -132,57 +141,47 @@ void vtkImageData::CopyInformationToPipeline(vtkInformation* request,
// current settings.
vtkInformation* output = this->PipelineInformation;
// Set origin (only if it is not set).
if (!output->Has(ORIGIN()))
if(input && input->Has(ORIGIN()))
{
if(input && input->Has(ORIGIN()))
{
output->CopyEntry(input, ORIGIN());
}
else
{
output->Set(ORIGIN(), this->GetOrigin(), 3);
}
output->CopyEntry(input, ORIGIN());
}
// Set spacing (only if it is not set).
if (!output->Has(SPACING()))
else if (!output->Has(ORIGIN()))
{
if(input && input->Has(SPACING()))
{
output->CopyEntry(input, SPACING());
}
else
{
output->Set(SPACING(), this->GetSpacing(), 3);
}
// Set origin (only if it is not set).
output->Set(ORIGIN(), this->GetOrigin(), 3);
}
// Set scalar type (only if it is not set).
if (!output->Has(SCALAR_TYPE()))
if(input && input->Has(SPACING()))
{
if(input && input->Has(SCALAR_TYPE()))
{
output->CopyEntry(input, SCALAR_TYPE());
}
else
{
output->Set(SCALAR_TYPE(), this->GetScalarType());
}
output->CopyEntry(input, SPACING());
}
else if (!output->Has(SPACING()))
{
// Set spacing (only if it is not set).
output->Set(SPACING(), this->GetSpacing(), 3);
}
// Set scalar number of components (only if it is not set).
if (!output->Has(SCALAR_NUMBER_OF_COMPONENTS()))
// copy of input to output (if input exists) occurs in vtkDataObject, so
// only to to check if the scalar info exists in the field data info of the output.
// If it exists, then we assume the type and number of components are set
vtkInformation *scalarInfo = vtkDataObject::GetActiveFieldInformation(output,
FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes::SCALARS);
if (!scalarInfo)
{
if(input && input->Has(SCALAR_NUMBER_OF_COMPONENTS()))
// see if we have the scalars to grab the name from
const char *scalarName = NULL;
vtkDataArray *scalars = this->GetPointData()->GetScalars();
if (scalars)
{
output->CopyEntry(input, SCALAR_NUMBER_OF_COMPONENTS());
}
else
{
output->Set(SCALAR_NUMBER_OF_COMPONENTS(),
this->GetNumberOfScalarComponents());
scalarName = scalars->GetName();
}
scalarInfo = vtkDataObject::SetActiveAttribute(output,
vtkDataObject::FIELD_ASSOCIATION_POINTS, scalarName,
vtkDataSetAttributes::SCALARS);
scalarInfo->Set(FIELD_ARRAY_TYPE(), this->GetScalarType());
scalarInfo->Set(FIELD_NUMBER_OF_COMPONENTS(), this->GetNumberOfScalarComponents());
}
}
}
......@@ -1188,7 +1187,7 @@ void vtkImageData::SetNumberOfScalarComponents(int num)
this->GetProducerPort();
if(vtkInformation* info = this->GetPipelineInformation())
{
info->Set(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS(), num);
vtkDataObject::SetPointDataActiveScalarInfo(info, -1, num);
}
else
{
......@@ -1215,9 +1214,11 @@ int vtkImageData::GetPipelineNumberOfScalarComponents()
this->GetProducerPort();
if(vtkInformation* info = this->GetPipelineInformation())
{
if (info->Has(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS()))
vtkInformation *scalarInfo = vtkDataObject::GetActiveFieldInformation(info,
FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes::SCALARS);
if (scalarInfo && scalarInfo->Has(FIELD_NUMBER_OF_COMPONENTS()))
{
return info->Get(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS());
return scalarInfo->Get( FIELD_NUMBER_OF_COMPONENTS() );
}
}
return 1;
......@@ -1501,7 +1502,7 @@ void vtkImageData::SetScalarType(int type)
this->GetProducerPort();
if(vtkInformation* info = this->GetPipelineInformation())
{
info->Set(vtkDataObject::SCALAR_TYPE(), type);
vtkDataObject::SetPointDataActiveScalarInfo(info, type, -1);
}
else
{
......@@ -1527,9 +1528,11 @@ int vtkImageData::GetPipelineScalarType()
this->GetProducerPort();
if(vtkInformation* info = this->GetPipelineInformation())
{
if (info->Has(vtkDataObject::SCALAR_TYPE()))
vtkInformation *scalarInfo = vtkDataObject::GetActiveFieldInformation(info,
FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes::SCALARS);
if (scalarInfo)
{
return info->Get(vtkDataObject::SCALAR_TYPE());
return scalarInfo->Get( FIELD_ARRAY_TYPE() );
}
}
return VTK_DOUBLE;
......@@ -1545,13 +1548,15 @@ void vtkImageData::AllocateScalars()
this->GetProducerPort();
if(vtkInformation* info = this->GetPipelineInformation())
{
if (info->Has(vtkDataObject::SCALAR_TYPE()))
vtkInformation *scalarInfo = vtkDataObject::GetActiveFieldInformation(info,
FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes::SCALARS);
if (scalarInfo)
{
newType = info->Get(vtkDataObject::SCALAR_TYPE());
}
if (info->Has(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS()))
{
newNumComp = info->Get(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS());
newType = scalarInfo->Get( FIELD_ARRAY_TYPE() );
if ( scalarInfo->Has(FIELD_NUMBER_OF_COMPONENTS()) )
{
newNumComp = scalarInfo->Get( FIELD_NUMBER_OF_COMPONENTS() );
}
}
}
......
......@@ -25,7 +25,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkImageToStructuredPoints, "1.60");
vtkCxxRevisionMacro(vtkImageToStructuredPoints, "1.61");
vtkStandardNewMacro(vtkImageToStructuredPoints);
//----------------------------------------------------------------------------
......@@ -231,10 +231,17 @@ int vtkImageToStructuredPoints::RequestInformation (
int whole[6], *tmp;
double *spacing, origin[3];
outInfo->Set(vtkDataObject::SCALAR_TYPE(),
inInfo->Get(vtkDataObject::SCALAR_TYPE()));
outInfo->Set(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS(),
inInfo->Get(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS()));
vtkInformation *inScalarInfo = vtkDataObject::GetActiveFieldInformation(inInfo,
vtkDataObject::FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes::SCALARS);
if (!inScalarInfo)
{
vtkErrorMacro("Missing scalar field on input information!");
return 0;
}
vtkDataObject::SetPointDataActiveScalarInfo(outInfo,
inScalarInfo->Get( vtkDataObject::FIELD_ARRAY_TYPE() ),
inScalarInfo->Get( vtkDataObject::FIELD_NUMBER_OF_COMPONENTS() ) );
inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),whole);
spacing = inInfo->Get(vtkDataObject::SPACING());
inInfo->Get(vtkDataObject::ORIGIN(), origin);
......
......@@ -22,7 +22,7 @@
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
vtkCxxRevisionMacro(vtkAssignAttribute, "1.11");
vtkCxxRevisionMacro(vtkAssignAttribute, "1.12");
vtkStandardNewMacro(vtkAssignAttribute);
char vtkAssignAttribute::AttributeLocationNames[2][12]
......@@ -173,6 +173,42 @@ void vtkAssignAttribute::Assign(const char* name,
}
}
int vtkAssignAttribute::RequestInformation(vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
if ((this->AttributeType != -1) &&
(this->AttributeLocation != -1) && (this->FieldType != -1))
{
int fieldAssociation = this->AttributeLocation == POINT_DATA ?
vtkDataObject::FIELD_ASSOCIATION_POINTS : vtkDataObject::FIELD_ASSOCIATION_CELLS;
if (this->FieldType == vtkAssignAttribute::NAME && this->FieldName)
{
vtkDataObject::SetActiveAttribute(outInfo, fieldAssociation,
this->FieldName, this->AttributeType);
}
else if (this->FieldType == vtkAssignAttribute::ATTRIBUTE &&
this->InputAttributeType != -1)
{
vtkInformation *inputAttributeInfo = vtkDataObject::GetActiveFieldInformation(
inInfo, fieldAssociation, this->InputAttributeType);
if (inputAttributeInfo) // do we have an active field of requested type
{
vtkDataObject::SetActiveAttribute(outInfo, fieldAssociation,
inputAttributeInfo->Get( vtkDataObject::FIELD_NAME() ),
this->AttributeType);
}
}
}
return 1;
}
int vtkAssignAttribute::RequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
......
......@@ -106,6 +106,7 @@ protected:
vtkAssignAttribute();
virtual ~vtkAssignAttribute();
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
char* FieldName;
......
......@@ -37,7 +37,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkImplicitModeller, "1.94");
vtkCxxRevisionMacro(vtkImplicitModeller, "1.95");
vtkStandardNewMacro(vtkImplicitModeller);
struct vtkImplicitModellerAppendInfo
......@@ -692,9 +692,8 @@ int vtkImplicitModeller::RequestInformation (
int i;
double ar[3], origin[3];
outInfo->Set(vtkDataObject::SCALAR_TYPE(),VTK_FLOAT);
outInfo->Set(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS(),1);
vtkDataObject::SetPointDataActiveScalarInfo(outInfo, VTK_FLOAT, 1);
outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),
0, this->SampleDimensions[0]-1,
0, this->SampleDimensions[1]-1,
......
......@@ -23,7 +23,7 @@
#include "vtkRenderWindow.h"
#include "vtkRenderer.h"
vtkCxxRevisionMacro(vtkRenderLargeImage, "1.29");
vtkCxxRevisionMacro(vtkRenderLargeImage, "1.30");
vtkStandardNewMacro(vtkRenderLargeImage);
vtkCxxSetObjectMacro(vtkRenderLargeImage,Input,vtkRenderer);
......@@ -128,8 +128,7 @@ void vtkRenderLargeImage::RequestInformation (
outInfo->Set(vtkDataObject::ORIGIN(),0.0, 0.0, 0.0);
// set the scalar components
outInfo->Set(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS(), 3);
outInfo->Set(vtkDataObject::SCALAR_TYPE(), VTK_UNSIGNED_CHAR);
vtkDataObject::SetPointDataActiveScalarInfo(outInfo, VTK_UNSIGNED_CHAR, 3);
}
......
......@@ -22,7 +22,7 @@
#include "vtkObjectFactory.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkTransformToGrid, "1.19");
vtkCxxRevisionMacro(vtkTransformToGrid, "1.20");
vtkStandardNewMacro(vtkTransformToGrid);
vtkCxxSetObjectMacro(vtkTransformToGrid,Input,vtkAbstractTransform);
......@@ -117,8 +117,7 @@ void vtkTransformToGrid::RequestInformation (
this->GridExtent,6);
outInfo->Set(vtkDataObject::SPACING(),this->GridSpacing,3);
outInfo->Set(vtkDataObject::ORIGIN(),this->GridOrigin,3);
outInfo->Set(vtkDataObject::SCALAR_TYPE(),this->GridScalarType);
outInfo->Set(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS(),3);
vtkDataObject::SetPointDataActiveScalarInfo(outInfo, this->GridScalarType, 3);
}
//----------------------------------------------------------------------------
......
......@@ -69,7 +69,7 @@
// Finally, when Execute() is reading from the FrameBuffer it must do
// so from within a mutex lock. Otherwise tearing artifacts might result.
vtkCxxRevisionMacro(vtkVideoSource, "1.42");
vtkCxxRevisionMacro(vtkVideoSource, "1.43");
vtkStandardNewMacro(vtkVideoSource);
#if ( _MSC_VER >= 1300 ) // Visual studio .NET
......@@ -985,9 +985,8 @@ int vtkVideoSource::RequestInformation(
outInfo->Set(vtkDataObject::ORIGIN(),this->DataOrigin,3);
// set default data type (8 bit greyscale)
outInfo->Set(vtkDataObject::SCALAR_TYPE(), VTK_UNSIGNED_CHAR);
outInfo->Set(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS(),
this->NumberOfScalarComponents);
vtkDataObject::SetPointDataActiveScalarInfo(outInfo, VTK_UNSIGNED_CHAR,
this->NumberOfScalarComponents);
return 1;
}
......
......@@ -27,7 +27,7 @@
#include <ctype.h>
vtkCxxRevisionMacro(vtkGaussianCubeReader, "1.14");
vtkCxxRevisionMacro(vtkGaussianCubeReader, "1.15");
vtkStandardNewMacro(vtkGaussianCubeReader);
// Construct object with merging set to true.
......@@ -241,10 +241,10 @@ int vtkGaussianCubeReader::RequestInformation(
0, n1-1, 0, n2-1, 0, n3-1);
gridInfo->Set(vtkDataObject::ORIGIN(), 0, 0, 0);
gridInfo->Set(vtkDataObject::SPACING(), 1, 1, 1);
gridInfo->Set(vtkDataObject::SCALAR_TYPE(), VTK_FLOAT);
fclose(fp);
vtkDataObject::SetPointDataActiveScalarInfo(gridInfo, VTK_FLOAT, -1);
return 1;
}
......
......@@ -23,7 +23,7 @@
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkTransform.h"
vtkCxxRevisionMacro(vtkImageReader, "1.117");
vtkCxxRevisionMacro(vtkImageReader, "1.118");
vtkStandardNewMacro(vtkImageReader);
vtkCxxSetObjectMacro(vtkImageReader,Transform,vtkTransform);
......@@ -130,10 +130,8 @@ int vtkImageReader::RequestInformation (
this->ComputeTransformedOrigin(origin);
outInfo->Set(vtkDataObject::ORIGIN(), this->DataOrigin, 3);
outInfo->Set(vtkDataObject::SCALAR_TYPE(), this->DataScalarType);
outInfo->Set(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS(),
this->NumberOfScalarComponents);
vtkDataObject::SetPointDataActiveScalarInfo(outInfo, this->DataScalarType,
this->NumberOfScalarComponents);
return 1;
}
......
......@@ -24,7 +24,7 @@
#include <sys/stat.h>
vtkCxxRevisionMacro(vtkImageReader2, "1.33");
vtkCxxRevisionMacro(vtkImageReader2, "1.34");
vtkStandardNewMacro(vtkImageReader2);
#ifdef read
......@@ -440,10 +440,9 @@ int vtkImageReader2::RequestInformation (
this->DataExtent, 6);
outInfo->Set(vtkDataObject::SPACING(), this->DataSpacing, 3);
outInfo->Set(vtkDataObject::ORIGIN(), this->DataOrigin, 3);
outInfo->Set(vtkDataObject::SCALAR_TYPE(), this->DataScalarType);
outInfo->Set(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS(),
this->NumberOfScalarComponents);