1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397
|
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkDataObject.cxx,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkDataObject.h"
#include "vtkAlgorithmOutput.h"
#include "vtkExtentTranslator.h"
#include "vtkFieldData.h"
#include "vtkGarbageCollector.h"
#include "vtkInformation.h"
#include "vtkObjectFactory.h"
#include "vtkSource.h"
#include "vtkTrivialProducer.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkInformationDataObjectKey.h"
#include "vtkInformationDoubleKey.h"
#include "vtkInformationDoubleVectorKey.h"
#include "vtkInformationIntegerKey.h"
#include "vtkInformationIntegerPointerKey.h"
#include "vtkInformationIntegerVectorKey.h"
#include "vtkInformationInformationVectorKey.h"
#include "vtkInformationStringKey.h"
#include "vtkInformationVector.h"
#include "vtkDataSetAttributes.h"
vtkCxxRevisionMacro(vtkDataObject, "$Revision: 1.26.4.2 $");
vtkStandardNewMacro(vtkDataObject);
vtkCxxSetObjectMacro(vtkDataObject,Information,vtkInformation);
vtkCxxSetObjectMacro(vtkDataObject,FieldData,vtkFieldData);
vtkInformationKeyMacro(vtkDataObject, DATA_TYPE_NAME, String);
vtkInformationKeyMacro(vtkDataObject, DATA_OBJECT, DataObject);
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, DATA_TIME_INDEX, Integer);
vtkInformationKeyMacro(vtkDataObject, DATA_TIME, Double);
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);
vtkInformationKeyMacro(vtkDataObject, FIELD_OPERATION, Integer);
vtkInformationKeyRestrictedMacro(vtkDataObject, DATA_EXTENT, IntegerPointer, 6);
vtkInformationKeyRestrictedMacro(vtkDataObject, ORIGIN, DoubleVector, 3);
vtkInformationKeyRestrictedMacro(vtkDataObject, SPACING, DoubleVector, 3);
class vtkDataObjectToSourceFriendship
{
public:
static void SetOutput(vtkSource* source, int i, vtkDataObject* newData)
{
if(source)
{
// Make sure there is room in the source for this output.
if(i >= source->NumberOfOutputs)
{
source->SetNumberOfOutputs(i+1);
}
// Update the source's Outputs array.
vtkDataObject* oldData = source->Outputs[i];
if(newData)
{
newData->Register(source);
}
source->Outputs[i] = newData;
if(oldData)
{
oldData->UnRegister(source);
}
}
}
};
// Initialize static member that controls global data release
// after use by filter
static int vtkDataObjectGlobalReleaseDataFlag = 0;
const char vtkDataObject
::AssociationNames[vtkDataObject::NUMBER_OF_ASSOCIATIONS][55] =
{
"vtkDataObject::FIELD_ASSOCIATION_POINTS",
"vtkDataObject::FIELD_ASSOCIATION_CELLS",
"vtkDataObject::FIELD_ASSOCIATION_NONE",
"vtkDataObject::FIELD_ASSOCIATION_POINTS_THEN_CELLS"
};
//----------------------------------------------------------------------------
vtkDataObject::vtkDataObject()
{
this->Source = NULL;
this->PipelineInformation = 0;
this->Information = vtkInformation::New();
this->Information->Register(this);
this->Information->Delete();
// We have to assume that if a user is creating the data on their own,
// then they will fill it with valid data.
this->DataReleased = 0;
this->FieldData = NULL;
vtkFieldData *fd = vtkFieldData::New();
this->SetFieldData(fd);
fd->Delete();
}
//----------------------------------------------------------------------------
vtkDataObject::~vtkDataObject()
{
this->SetPipelineInformation(0);
this->SetInformation(0);
this->SetFieldData(NULL);
}
//----------------------------------------------------------------------------
void vtkDataObject::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
if ( this->Source )
{
os << indent << "Source: " << this->Source << "\n";
}
else
{
os << indent << "Source: (none)\n";
}
if ( this->Information )
{
os << indent << "Information: " << this->Information << "\n";
}
else
{
os << indent << "Information: (none)\n";
}
os << indent << "Data Released: "
<< (this->DataReleased ? "True\n" : "False\n");
os << indent << "Global Release Data: "
<< (vtkDataObjectGlobalReleaseDataFlag ? "On\n" : "Off\n");
os << indent << "UpdateTime: " << this->UpdateTime << endl;
if(vtkInformation* pInfo = this->GetPipelineInformation())
{
os << indent << "Release Data: "
<< (this->GetReleaseDataFlag() ? "On\n" : "Off\n");
if(pInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT_INITIALIZED()))
{
os << indent << "UpdateExtent: Initialized\n";
}
else
{
os << indent << "UpdateExtent: Not Initialized\n";
}
if(pInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT()))
{
int updateExtent[6] = {0,-1,0,-1,0,-1};
this->GetUpdateExtent(updateExtent);
os << indent << "UpdateExtent: " << updateExtent[0] << ", "
<< updateExtent[1] << ", " << updateExtent[2] << ", "
<< updateExtent[3] << ", " << updateExtent[4] << ", "
<< updateExtent[5] << endl;
}
if(pInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES()))
{
os << indent << "Update Number Of Pieces: "
<< pInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES())
<< endl;
}
if(pInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()))
{
os << indent << "Update Piece: "
<< pInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER())
<< endl;
}
if(pInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()))
{
os << indent << "Update Ghost Level: "
<< pInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS())
<< endl;
}
if(pInfo->Has(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()))
{
int wholeExtent[6] = {0,-1,0,-1,0,-1};
this->GetWholeExtent(wholeExtent);
os << indent << "WholeExtent: " << wholeExtent[0] << ", "
<< wholeExtent[1] << ", " << wholeExtent[2] << ", "
<< wholeExtent[3] << ", " << wholeExtent[4] << ", "
<< wholeExtent[5] << endl;
}
if(pInfo->Has(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES()))
{
os << indent << "MaximumNumberOfPieces: "
<< pInfo->Get(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES())
<< endl;
}
if(pInfo->Has(vtkStreamingDemandDrivenPipeline::EXTENT_TRANSLATOR()))
{
os << indent << "ExtentTranslator: ("
<< pInfo->Get(vtkStreamingDemandDrivenPipeline::EXTENT_TRANSLATOR())
<< ")\n";
}
if(pInfo->Get(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT()))
{
os << indent << "RequestExactExtent: On\n ";
}
else
{
os << indent << "RequestExactExtent: Off\n ";
}
}
os << indent << "Field Data:\n";
this->FieldData->PrintSelf(os,indent.GetNextIndent());
}
//----------------------------------------------------------------------------
void vtkDataObject::SetUpdateExtent(int piece, int numPieces, int ghostLevel)
{
if(SDDP* sddp = this->TrySDDP("SetUpdateExtent"))
{
// this code used to check the return value of the
// SetUpdateExtent method which would indicate if the
// UpdatePiece, UpdateNumberOfPieces, or UpdateGhostLevel
// had changed, and call Modified(). We actually don't want
// to do this - just a change in the update extent does not
// make this object modified!
sddp->SetUpdateExtent
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()), piece, numPieces, ghostLevel);
}
}
//----------------------------------------------------------------------------
void vtkDataObject::SetPipelineInformation(vtkInformation* newInfo)
{
vtkInformation* oldInfo = this->PipelineInformation;
if(newInfo != oldInfo)
{
// Remove any existing compatibility link to a source.
this->Source = 0;
if(newInfo)
{
// Reference the new information.
newInfo->Register(this);
// Detach the output that used to be held by the new information.
if(vtkDataObject* oldData = newInfo->Get(vtkDataObject::DATA_OBJECT()))
{
oldData->Register(this);
oldData->SetPipelineInformation(0);
oldData->UnRegister(this);
}
// Tell the new information about this object.
newInfo->Set(vtkDataObject::DATA_OBJECT(), this);
// If the new producer is a vtkSource then setup the backward
// compatibility link.
vtkExecutive* newExec = newInfo->GetExecutive(vtkExecutive::PRODUCER());
int newPort = newInfo->GetPort(vtkExecutive::PRODUCER());
if(newExec)
{
vtkSource* newSource = vtkSource::SafeDownCast(newExec->GetAlgorithm());
if(newSource)
{
vtkDataObjectToSourceFriendship::SetOutput(newSource, newPort, this);
this->Source = newSource;
}
}
}
// Save the pointer to the new information.
this->PipelineInformation = newInfo;
if(oldInfo)
{
// If the old producer was a vtkSource then remove the backward
// compatibility link.
vtkExecutive* oldExec = oldInfo->GetExecutive(vtkExecutive::PRODUCER());
int oldPort = oldInfo->GetPort(vtkExecutive::PRODUCER());
if(oldExec)
{
vtkSource* oldSource = vtkSource::SafeDownCast(oldExec->GetAlgorithm());
if(oldSource)
{
vtkDataObjectToSourceFriendship::SetOutput(oldSource, oldPort, 0);
}
}
// Remove the old information's reference to us.
oldInfo->Set(vtkDataObject::DATA_OBJECT(), 0);
// Remove our reference to the old information.
oldInfo->UnRegister(this);
}
}
}
//----------------------------------------------------------------------------
vtkAlgorithmOutput* vtkDataObject::GetProducerPort()
{
// Make sure there is an executive.
if(!this->GetExecutive())
{
vtkTrivialProducer* tp = vtkTrivialProducer::New();
tp->SetOutput(this);
tp->Delete();
}
// Get the port from the executive.
return this->GetExecutive()->GetProducerPort(this);
}
//----------------------------------------------------------------------------
// Determine the modified time of this object
unsigned long int vtkDataObject::GetMTime()
{
unsigned long result;
result = vtkObject::GetMTime();
if ( this->FieldData )
{
unsigned long mtime = this->FieldData->GetMTime();
result = ( mtime > result ? mtime : result);
}
return result;
}
//----------------------------------------------------------------------------
void vtkDataObject::Initialize()
{
this->FieldData->Initialize();
this->Modified();
}
//----------------------------------------------------------------------------
void vtkDataObject::SetGlobalReleaseDataFlag(int val)
{
if (val == vtkDataObjectGlobalReleaseDataFlag)
{
return;
}
vtkDataObjectGlobalReleaseDataFlag = val;
}
//----------------------------------------------------------------------------
void vtkDataObject::CopyInformationToPipeline(vtkInformation *request,
vtkInformation *input)
{
// 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;
if (input)
{
// copy point data.
if (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);
}
// copy the actual time
if (input->Has(DATA_TIME()))
{
output->CopyEntry(input, DATA_TIME());
}
// copy the time index
if (input->Has(DATA_TIME_INDEX()))
{
output->CopyEntry(input, DATA_TIME_INDEX());
}
}
}
}
//----------------------------------------------------------------------------
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::GetNamedFieldInformation(vtkInformation *info,
int fieldAssociation,
const char *name)
{
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_NAME()) &&
!strcmp(fieldDataInfo->Get(FIELD_NAME()),name))
{
return fieldDataInfo;
}
}
return NULL;
}
//----------------------------------------------------------------------------
void vtkDataObject::RemoveNamedFieldInformation(vtkInformation *info,
int fieldAssociation,
const char *name)
{
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;
}
if (!fieldDataInfoVector)
{
return;
}
for (i = 0; i < fieldDataInfoVector->GetNumberOfInformationObjects(); i++)
{
fieldDataInfo = fieldDataInfoVector->GetInformationObject(i);
if ( fieldDataInfo->Has(FIELD_NAME()) &&
!strcmp(fieldDataInfo->Get(FIELD_NAME()),name))
{
fieldDataInfoVector->Remove(fieldDataInfo);
return;
}
}
return;
}
//----------------------------------------------------------------------------
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);
}
// Set the scalar type if it was given. If it was not given and
// there is no current scalar type set the default to VTK_DOUBLE.
if (arrayType != -1)
{
attrInfo->Set(FIELD_ARRAY_TYPE(), arrayType);
}
else if(!attrInfo->Has(FIELD_ARRAY_TYPE()))
{
attrInfo->Set(FIELD_ARRAY_TYPE(), VTK_DOUBLE);
}
// Set the number of components if it was given. If it was not
// given and there is no current number of components set the
// default to 1.
if (numComponents != -1)
{
attrInfo->Set(FIELD_NUMBER_OF_COMPONENTS(), numComponents);
}
else if(!attrInfo->Has(FIELD_NUMBER_OF_COMPONENTS()))
{
attrInfo->Set(FIELD_NUMBER_OF_COMPONENTS(), 1);
}
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()
{
this->DataReleased = 0;
this->UpdateTime.Modified();
// This is here so that the data can be easlily marked as up to date.
// It is used specifically when the filter vtkQuadricClustering
// is executed manually with the append methods.
this->Information->Set(DATA_PIECE_NUMBER(), this->GetUpdatePiece());
this->Information->Set(DATA_NUMBER_OF_PIECES(), this->GetUpdateNumberOfPieces());
this->Information->Set(DATA_NUMBER_OF_GHOST_LEVELS(), this->GetUpdateGhostLevel());
}
//----------------------------------------------------------------------------
int vtkDataObject::GetGlobalReleaseDataFlag()
{
return vtkDataObjectGlobalReleaseDataFlag;
}
//----------------------------------------------------------------------------
void vtkDataObject::ReleaseData()
{
this->Initialize();
this->DataReleased = 1;
}
//----------------------------------------------------------------------------
int vtkDataObject::ShouldIReleaseData()
{
return vtkDataObjectGlobalReleaseDataFlag || this->GetReleaseDataFlag();
}
//----------------------------------------------------------------------------
void vtkDataObject::SetSource(vtkSource* newSource)
{
vtkDebugMacro( << this->GetClassName() << " ("
<< this << "): setting Source to " << newSource );
if(newSource)
{
// Find the output index on the source producing this data object.
int index = newSource->GetOutputIndex(this);
if(index >= 0)
{
newSource->GetExecutive()->SetOutputData(index, this);
}
else
{
vtkErrorMacro("SetSource cannot find the output index of this "
"data object from the source.");
this->SetPipelineInformation(0);
}
}
else
{
this->SetPipelineInformation(0);
}
}
//----------------------------------------------------------------------------
void vtkDataObject::Register(vtkObjectBase* o)
{
this->RegisterInternal(o, 1);
}
//----------------------------------------------------------------------------
void vtkDataObject::UnRegister(vtkObjectBase* o)
{
this->UnRegisterInternal(o, 1);
}
//----------------------------------------------------------------------------
unsigned long vtkDataObject::GetUpdateTime()
{
return this->UpdateTime.GetMTime();
}
unsigned long vtkDataObject::GetEstimatedMemorySize()
{
// This should be implemented in a subclass. If not, default to
// estimating that no memory is used.
return 0;
}
//----------------------------------------------------------------------------
vtkExecutive* vtkDataObject::GetExecutive()
{
if(this->PipelineInformation)
{
return this->PipelineInformation->GetExecutive(vtkExecutive::PRODUCER());
}
return 0;
}
//----------------------------------------------------------------------------
int vtkDataObject::GetPortNumber()
{
if(this->PipelineInformation)
{
return this->PipelineInformation->GetPort(vtkExecutive::PRODUCER());
}
return 0;
}
//----------------------------------------------------------------------------
vtkStreamingDemandDrivenPipeline* vtkDataObject::TrySDDP(const char* method)
{
// Make sure there is an executive.
if(!this->GetExecutive())
{
vtkTrivialProducer* tp = vtkTrivialProducer::New();
tp->SetOutput(this);
tp->Delete();
}
// Try downcasting the executive to the proper type.
if(SDDP* sddp = SDDP::SafeDownCast(this->GetExecutive()))
{
return sddp;
}
else if(method)
{
vtkErrorMacro("Method " << method << " cannot be called unless the "
"data object is managed by a "
"vtkStreamingDemandDrivenPipeline.");
}
return 0;
}
//----------------------------------------------------------------------------
unsigned long vtkDataObject::GetActualMemorySize()
{
return this->FieldData->GetActualMemorySize();
}
//----------------------------------------------------------------------------
void vtkDataObject::CopyInformation( vtkDataObject *data )
{
if ( this->GetExtentType() == VTK_3D_EXTENT &&
data->GetExtentType() == VTK_3D_EXTENT )
{
this->SetWholeExtent(data->GetWholeExtent());
}
else
{
this->SetMaximumNumberOfPieces(data->GetMaximumNumberOfPieces());
}
this->SetExtentTranslator(data->GetExtentTranslator());
}
//----------------------------------------------------------------------------
void vtkDataObject::ShallowCopy(vtkDataObject *src)
{
if (!src)
{
vtkWarningMacro("Attempted to ShallowCopy from null.");
return;
}
this->InternalDataObjectCopy(src);
if (!src->FieldData)
{
this->SetFieldData(0);
}
else
{
if (this->FieldData)
{
this->FieldData->ShallowCopy(src->FieldData);
}
else
{
vtkFieldData* fd = vtkFieldData::New();
fd->ShallowCopy(src->FieldData);
this->SetFieldData(fd);
fd->Delete();
}
}
}
//----------------------------------------------------------------------------
void vtkDataObject::DeepCopy(vtkDataObject *src)
{
vtkFieldData *srcFieldData = src->GetFieldData();
this->InternalDataObjectCopy(src);
if (srcFieldData)
{
vtkFieldData *newFieldData = vtkFieldData::New();
newFieldData->DeepCopy(srcFieldData);
this->SetFieldData(newFieldData);
newFieldData->Delete();
}
else
{
this->SetFieldData(NULL);
}
}
//----------------------------------------------------------------------------
void vtkDataObject::InternalDataObjectCopy(vtkDataObject *src)
{
// If the input data object has pipeline information and this object
// does not, setup a trivial producer so that this object will have
// pipeline information into which to copy values.
if(src->GetPipelineInformation() && !this->GetPipelineInformation())
{
this->GetProducerPort();
}
this->DataReleased = src->DataReleased;
if(src->Information->Has(DATA_PIECE_NUMBER()))
{
this->Information->Set(DATA_PIECE_NUMBER(),
src->Information->Get(DATA_PIECE_NUMBER()));
}
if(src->Information->Has(DATA_NUMBER_OF_PIECES()))
{
this->Information->Set(DATA_NUMBER_OF_PIECES(),
src->Information->Get(DATA_NUMBER_OF_PIECES()));
}
if(src->Information->Has(DATA_NUMBER_OF_GHOST_LEVELS()))
{
this->Information->Set(DATA_NUMBER_OF_GHOST_LEVELS(),
src->Information->Get(DATA_NUMBER_OF_GHOST_LEVELS()));
}
vtkInformation* thatPInfo = src->GetPipelineInformation();
vtkInformation* thisPInfo = this->GetPipelineInformation();
if(thisPInfo && thatPInfo)
{
// copy the pipeline info if it is available
if(thisPInfo)
{
// Do not override info if it exists. Normally WHOLE_EXTENT
// and MAXIMUM_NUMBER_OF_PIECES should not be copied here since
// they belong to the pipeline not the data object.
// However, removing the copy can break things in older filters
// that rely on ShallowCopy to set these (mostly, sources/filters
// that use another source/filter internally and shallow copy
// in RequestInformation). As a compromise, I changed the following
// code such that these entries are only copied if they do not
// exist in the output.
if (!thisPInfo->Has(SDDP::WHOLE_EXTENT()))
{
thisPInfo->CopyEntry(thatPInfo, SDDP::WHOLE_EXTENT());
}
if (!thisPInfo->Has(SDDP::MAXIMUM_NUMBER_OF_PIECES()))
{
thisPInfo->CopyEntry(thatPInfo, SDDP::MAXIMUM_NUMBER_OF_PIECES());
}
thisPInfo->CopyEntry(thatPInfo, vtkDemandDrivenPipeline::RELEASE_DATA());
}
}
// This also caused a pipeline problem.
// An input pipelineMTime was copied to output. Pipeline did not execute...
// We do not copy MTime of object, so why should we copy these.
//this->PipelineMTime = src->PipelineMTime;
//this->UpdateTime = src->UpdateTime;
//this->Locality = src->Locality;
}
//----------------------------------------------------------------------------
// This should be a pure virutal method.
void vtkDataObject::Crop()
{
}
//----------------------------------------------------------------------------
void vtkDataObject::ReportReferences(vtkGarbageCollector* collector)
{
this->Superclass::ReportReferences(collector);
vtkGarbageCollectorReport(collector, this->Information, "Information");
vtkGarbageCollectorReport(collector, this->PipelineInformation,
"PipelineInformation");
}
//----------------------------------------------------------------------------
void vtkDataObject::Update()
{
if(SDDP* sddp = this->TrySDDP("Update"))
{
sddp->Update(this->GetPortNumber());
}
}
//----------------------------------------------------------------------------
void vtkDataObject::UpdateInformation()
{
if(SDDP* sddp = this->TrySDDP("UpdateInformation"))
{
sddp->UpdateInformation();
}
}
//----------------------------------------------------------------------------
void vtkDataObject::PropagateUpdateExtent()
{
if(SDDP* sddp = this->TrySDDP("PropagateUpdateExtent"))
{
sddp->PropagateUpdateExtent(this->GetPortNumber());
}
}
//----------------------------------------------------------------------------
void vtkDataObject::TriggerAsynchronousUpdate()
{
}
//----------------------------------------------------------------------------
void vtkDataObject::UpdateData()
{
if(SDDP* sddp = this->TrySDDP("UpdateData"))
{
sddp->UpdateData(this->GetPortNumber());
}
}
//----------------------------------------------------------------------------
void vtkDataObject::SetUpdateExtentToWholeExtent()
{
if(SDDP* sddp = this->TrySDDP("SetUpdateExtentToWholeExtent"))
{
// this code used to check the return value of the
// SetUpdateExtentToWholeExtent method which would
// indicate if the update extent had changed, and call
// Modified(). We actually don't want to do this - just
// a change in the update extent does not make this object
// modified!
sddp->SetUpdateExtentToWholeExtent
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()));
}
}
//----------------------------------------------------------------------------
void vtkDataObject::SetMaximumNumberOfPieces(int n)
{
if(SDDP* sddp = this->TrySDDP("SetMaximumNumberOfPieces"))
{
if(sddp->SetMaximumNumberOfPieces
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()), n))
{
this->Modified();
}
}
}
//----------------------------------------------------------------------------
int vtkDataObject::GetMaximumNumberOfPieces()
{
if(SDDP* sddp = this->TrySDDP("GetMaximumNumberOfPieces"))
{
return sddp->GetMaximumNumberOfPieces
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()));
}
return -1;
}
//----------------------------------------------------------------------------
void vtkDataObject::SetWholeExtent(int x0, int x1, int y0, int y1,
int z0, int z1)
{
int extent[6] = {x0, x1, y0, y1, z0, z1};
this->SetWholeExtent(extent);
}
//----------------------------------------------------------------------------
void vtkDataObject::SetWholeExtent(int extent[6])
{
if(SDDP* sddp = this->TrySDDP("SetWholeExtent"))
{
if(sddp->SetWholeExtent
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()), extent))
{
this->Modified();
}
}
}
//----------------------------------------------------------------------------
int* vtkDataObject::GetWholeExtent()
{
if(SDDP* sddp = this->TrySDDP("GetWholeExtent"))
{
return sddp->GetWholeExtent
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()));
}
else
{
static int extent[6] = {0,-1,0,-1,0,-1};
return extent;
}
}
//----------------------------------------------------------------------------
void vtkDataObject::GetWholeExtent(int& x0, int& x1, int& y0, int& y1,
int& z0, int& z1)
{
int extent[6];
this->GetWholeExtent(extent);
x0 = extent[0];
x1 = extent[1];
y0 = extent[2];
y1 = extent[3];
z0 = extent[4];
z1 = extent[5];
}
//----------------------------------------------------------------------------
void vtkDataObject::GetWholeExtent(int extent[6])
{
if(SDDP* sddp = this->TrySDDP("GetWholeExtent"))
{
sddp->GetWholeExtent
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()), extent);
}
}
//----------------------------------------------------------------------------
void vtkDataObject::SetWholeBoundingBox(double x0, double x1, double y0,
double y1, double z0, double z1)
{
double bb[6] = {x0, x1, y0, y1, z0, z1};
this->SetWholeBoundingBox(bb);
}
//----------------------------------------------------------------------------
void vtkDataObject::SetWholeBoundingBox(double bb[6])
{
if(SDDP* sddp = this->TrySDDP("SetWholeBoundingBox"))
{
if(sddp->SetWholeBoundingBox(this->GetPortNumber(), bb))
{
this->Modified();
}
}
}
//----------------------------------------------------------------------------
double* vtkDataObject::GetWholeBoundingBox()
{
if(SDDP* sddp = this->TrySDDP("GetWholeBoundingBox"))
{
return sddp->GetWholeBoundingBox(this->GetPortNumber());
}
else
{
static double bb[6] = {0,-1,0,-1,0,-1};
return bb;
}
}
//----------------------------------------------------------------------------
void vtkDataObject::GetWholeBoundingBox(double& x0, double& x1, double& y0,
double& y1, double& z0, double& z1)
{
double extent[6];
this->GetWholeBoundingBox(extent);
x0 = extent[0];
x1 = extent[1];
y0 = extent[2];
y1 = extent[3];
z0 = extent[4];
z1 = extent[5];
}
//----------------------------------------------------------------------------
void vtkDataObject::GetWholeBoundingBox(double extent[6])
{
if(SDDP* sddp = this->TrySDDP("GetWholeBoundingBox"))
{
sddp->GetWholeBoundingBox(this->GetPortNumber(), extent);
}
}
//----------------------------------------------------------------------------
void vtkDataObject::SetUpdateExtent(int x0, int x1, int y0, int y1,
int z0, int z1)
{
int extent[6] = {x0, x1, y0, y1, z0, z1};
this->SetUpdateExtent(extent);
}
//----------------------------------------------------------------------------
void vtkDataObject::SetUpdateExtent(int extent[6])
{
if(SDDP* sddp = this->TrySDDP("SetUpdateExtent"))
{
// this code used to check the return value of the
// SetUpdateExtent method which would indicate if the
// update extent had changed, and call Modified(). We
// actually don't want to do this - just a change in
// the update extent does not make this object modified!
sddp->SetUpdateExtent
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()), extent);
}
}
//----------------------------------------------------------------------------
int* vtkDataObject::GetUpdateExtent()
{
if(SDDP* sddp = this->TrySDDP("GetUpdateExtent"))
{
return sddp->GetUpdateExtent
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()));
}
else
{
static int extent[6] = {0,-1,0,-1,0,-1};
return extent;
}
}
//----------------------------------------------------------------------------
void vtkDataObject::GetUpdateExtent(int& x0, int& x1, int& y0, int& y1,
int& z0, int& z1)
{
int extent[6];
this->GetUpdateExtent(extent);
x0 = extent[0];
x1 = extent[1];
y0 = extent[2];
y1 = extent[3];
z0 = extent[4];
z1 = extent[5];
}
//----------------------------------------------------------------------------
void vtkDataObject::GetUpdateExtent(int extent[6])
{
if(SDDP* sddp = this->TrySDDP("GetUpdateExtent"))
{
sddp->GetUpdateExtent
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()), extent);
}
}
//----------------------------------------------------------------------------
void vtkDataObject::SetUpdatePiece(int piece)
{
if(SDDP* sddp = this->TrySDDP("SetUpdatePiece"))
{
if(sddp->SetUpdatePiece
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()), piece))
{
this->Modified();
}
}
}
//----------------------------------------------------------------------------
int vtkDataObject::GetUpdatePiece()
{
if(SDDP* sddp = this->TrySDDP("GetUpdatePiece"))
{
return sddp->GetUpdatePiece
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()));
}
return 0;
}
//----------------------------------------------------------------------------
void vtkDataObject::SetUpdateNumberOfPieces(int n)
{
if(SDDP* sddp = this->TrySDDP("SetUpdateNumberOfPieces"))
{
if(sddp->SetUpdateNumberOfPieces
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()), n))
{
this->Modified();
}
}
}
//----------------------------------------------------------------------------
int vtkDataObject::GetUpdateNumberOfPieces()
{
if(SDDP* sddp = this->TrySDDP("GetUpdateNumberOfPieces"))
{
return sddp->GetUpdateNumberOfPieces
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()));
}
return 1;
}
//----------------------------------------------------------------------------
void vtkDataObject::SetUpdateGhostLevel(int level)
{
if(SDDP* sddp = this->TrySDDP("SetUpdateGhostLevel"))
{
if(sddp->SetUpdateGhostLevel
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()), level))
{
this->Modified();
}
}
}
//----------------------------------------------------------------------------
int vtkDataObject::GetUpdateGhostLevel()
{
if(SDDP* sddp = this->TrySDDP("GetUpdateGhostLevel"))
{
return sddp->GetUpdateGhostLevel
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()));
}
return 0;
}
//----------------------------------------------------------------------------
void vtkDataObject::SetExtentTranslator(vtkExtentTranslator* translator)
{
if(SDDP* sddp = this->TrySDDP("SetExtentTranslator"))
{
if(sddp->SetExtentTranslator
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()), translator))
{
this->Modified();
}
}
}
//----------------------------------------------------------------------------
vtkExtentTranslator* vtkDataObject::GetExtentTranslator()
{
if(SDDP* sddp = this->TrySDDP("GetExtentTranslator"))
{
return sddp->GetExtentTranslator
(sddp->GetOutputInformation()->GetInformationObject
(this->GetPortNumber()));
}
return 0;
}
//----------------------------------------------------------------------------
void vtkDataObject::SetReleaseDataFlag(int value)
{
if(SDDP* sddp = this->TrySDDP("SetReleaseDataFlag"))
{
if(sddp->SetReleaseDataFlag(this->GetPortNumber(), value))
{
this->Modified();
}
}
}
//----------------------------------------------------------------------------
int vtkDataObject::GetReleaseDataFlag()
{
if(SDDP* sddp = this->TrySDDP("GetReleaseDataFlag"))
{
return sddp->GetReleaseDataFlag(this->GetPortNumber());
}
return 0;
}
//----------------------------------------------------------------------------
unsigned long vtkDataObject::GetPipelineMTime()
{
if(SDDP* sddp = this->TrySDDP("GetPipelineMTime"))
{
return sddp->GetPipelineMTime();
}
return 0;
}
//----------------------------------------------------------------------------
void vtkDataObject::SetRequestExactExtent(int flag)
{
if(SDDP* sddp = this->TrySDDP("SetRequestExactExtent"))
{
sddp->SetRequestExactExtent(this->GetPortNumber(), flag);
}
}
//----------------------------------------------------------------------------
int vtkDataObject::GetRequestExactExtent()
{
if(SDDP* sddp = this->TrySDDP("GetRequestExactExtent"))
{
return sddp->GetRequestExactExtent(this->GetPortNumber());
}
return 0;
}
//----------------------------------------------------------------------------
vtkDataObject* vtkDataObject::GetData(vtkInformation* info)
{
return info? info->Get(DATA_OBJECT()) : 0;
}
//----------------------------------------------------------------------------
vtkDataObject* vtkDataObject::GetData(vtkInformationVector* v, int i)
{
return vtkDataObject::GetData(v->GetInformationObject(i));
}
//----------------------------------------------------------------------------
const char* vtkDataObject::GetAssociationTypeAsString(int associationType)
{
if (associationType < 0 || associationType >= NUMBER_OF_ASSOCIATIONS)
{
vtkGenericWarningMacro("Bad association type.");
return NULL;
}
return vtkDataObject::AssociationNames[associationType];
}
|