RequestImformation过程针对pvtp文件的详细解析

来源:互联网 发布:飞翔打印软件官方下载 编辑:程序博客网 时间:2024/06/05 04:06

第一步

<pre name="code" class="cpp"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">    // Make sure that there is a file to get information from.</span>
    if (request->Has(vtkDemandDrivenPipeline::REQUEST_DATA_OBJECT()))      {      if (!this->Internal->FileNameIsSet && (this->GetNumberOfFileNames() > 0))        {        this->ReaderSetFileName(this->GetFileName(0));        this->_FileIndex = 0;        this->Internal->FileNameIsSet = true;        }      }<pre name="code" class="cpp">  // create the output  if (request->Has(vtkDemandDrivenPipeline::REQUEST_DATA_OBJECT()))    {    int retVal = this->RequestDataObject(request, inputVector, outputVector);    this->CurrentOutputInformation = 0;    return retVal;    }

第二步

// Our handling of these requests will call the reader's request in turn.    if (request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION()))      {      return this->RequestInformation(request, inputVector, outputVector);      }

然后依次执行:
int vtkFileSeriesReader::RequestInformation
+
int vtkFileSeriesReader::RequestInformationForInput
+

int vtkXMLPUnstructuredDataReader::RequestInformation
+
int vtkXMLReader::RequestInformation
+

int vtkXMLPDataReader::ReadXMLInformation(){  // First setup the filename components.  this->SplitFileName();  // Now proceed with reading the information.  return this->Superclass::ReadXMLInformation();}
+
int vtkXMLReader::ReadXMLInformation()
+在这里,创建XMLParser,把流加入到XMLParser中进行解析,然后得到头结点,运行ReadVTKFile去开始读取这个pvtp文件。
int vtkXMLReader::ReadVTKFile
+先检查version,然后获得数据集的名字PPolyData。并且在指针(VTKFile级)中找到这一级PPolyData开始的指针,返回这个指针,好从这一级继续往下找。

int vtkXMLReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)

+对TimeValues进行检测,要求其小于tsMax = 4096。然后对这个时候的ePrimary(PPolyData级)进行检测,看起子项中是否有"FieldData",有则使this->FieldDataElement = eNested;

int vtkXMLPDataReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
+先设定GhostLevel,然后检测其子节点中是否有:"Piece","PPointData","PCellData",这里读到有2片数据,则this->SetupPieces(numPieces);,初始化两片数据,接着走到"Piece"这一级,执行:
int vtkXMLPDataReader::ReadPiece(vtkXMLDataElement* ePiece)
+解析Piece这一级的参数,获得Source的值,fileName,然后加工出绝对路径。接着创建读这片数据的reader。依次进行第二片。。。

int vtkXMLPUnstructuredDataReader::ReadPrimaryElement(vtkXMLDataElement* ePri)
+执行完上面的部分之后,ePri回到了PPolyData这一级。再找子级中的"PPoints",赋值this->PPointsElement = eNested;到这里,ReadXMLInformation()就全部结束了。接着一系列的timestep等的设置之后执行:
int vtkXMLReader::ProcessRequest下的 if (request->Has(vtkDemandDrivenPipeline::REQUEST_DATA_OBJECT()))    {    int retVal = this->RequestDataObject(request, inputVector, outputVector);    this->CurrentOutputInformation = 0;    return retVal;    }
+

int vtkXMLReader::ProcessRequest下的:if (request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION()))    {    int retVal = this->RequestInformation(request, inputVector, outputVector);    this->CurrentOutputInformation = 0;    return retVal;    }
··········重新又执行了一遍上面的过程,但是由于时间不对等的原因,没有执行那些关键操作,不知道为啥会再执行上面的过程。
这个过程这些命令的发起,不知道是由什么控制的。

现在来看看.ply文件的RequestInfomation的过程:

它的过程中,第一遍没有进RequestInfomation,第二遍进去了,然后就到需要apply了。
























0 0
原创粉丝点击