31 #include <vtkInformationExecutivePortKey.h> 32 #include <vtkInformation.h> 33 #include <vtkInformationVector.h> 34 #include <vtkStreamingDemandDrivenPipeline.h> 65 std::cout <<
"srvBase constructed" << std::endl;
69 std::cout <<
"srvBase destructed" << std::endl;
72 int srvBase::ProcessRequest(vtkInformation *request,
73 vtkInformationVector **inputVector,
74 vtkInformationVector *outputVector) {
76 if (request->Has(vtkDemandDrivenPipeline::REQUEST_DATA_OBJECT())) {
81 if (request->Has(vtkDemandDrivenPipeline::REQUEST_DATA())) {
82 return this->
RequestData(request, inputVector, outputVector);
85 if (request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT())) {
90 if (request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION())) {
94 return this->Superclass::ProcessRequest(request, inputVector, outputVector);
98 vtkInformationVector **inputVector,
99 vtkInformationVector *outputVector) {
107 return NEM::MSH::geoMeshBase::SafeDownCast(this->GetOutputDataObject(port));
111 vtkInformationVector **inputVector,
112 vtkInformationVector *outputVector) {
113 for (
int i = 0; i < outputVector->GetNumberOfInformationObjects(); ++i) {
114 auto outInfo = outputVector->GetInformationObject(i);
115 auto outAlgInfo = this->GetOutputPortInformation(i);
116 if (!outAlgInfo->Has(vtkDataObject::DATA_TYPE_NAME())) {
119 std::string typeName = outAlgInfo->Get(vtkDataObject::DATA_TYPE_NAME());
121 if (typeName ==
"vtkGeoMesh") {
123 }
else if (typeName ==
"gmshGeoMesh") {
127 }
else if (typeName ==
"oshGeoMesh") {
129 }
else if (typeName ==
"exoGeoMesh") {
131 }
else if (typeName ==
"inpGeoMesh") {
133 }
else if (typeName ==
"foamGeoMesh") {
137 }
else if (typeName ==
"smeshGeoMesh") {
141 }
else if (typeName ==
"geoMeshBase") {
142 if (i < this->GetNumberOfInputPorts() &&
143 inputVector[i]->GetNumberOfInformationObjects() > 0) {
144 auto inObj = inputVector[i]
145 ->GetInformationObject(0)
146 ->Get(vtkDataObject::DATA_OBJECT());
148 output = MSH::geoMeshBase::SafeDownCast(inObj->NewInstance());
155 outInfo->Set(vtkDataObject::DATA_OBJECT(), output);
156 output->FastDelete();
157 this->GetOutputPortInformation(i)->Set(
158 vtkDataObject::DATA_EXTENT_TYPE(), output->GetExtentType());
164 vtkInformationVector **inputVector,
165 vtkInformationVector *outputVector) {
166 int numInputPorts = this->GetNumberOfInputPorts();
167 for (
int i = 0; i < numInputPorts; i++) {
168 int numInputConnections = this->GetNumberOfInputConnections(i);
169 for (
int j = 0; j < numInputConnections; j++) {
170 vtkInformation *inputInfo = inputVector[i]->GetInformationObject(j);
171 inputInfo->Set(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT(), 1);
static smeshGeoMesh * New()
static inpGeoMesh * New()
static exoGeoMesh * New()
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)=0
This is called by the superclass.
static foamGeoMesh * New()
vtkAbstractTypeMacro(srvBase, vtkAlgorithm) public NEM::MSH::geoMeshBase * GetOutput()
Get the output GeoMeshBase for a port on this algorithm.
static vtkGeoMesh * New()
virtual int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
abstract class to specify geometry and mesh data
static oshGeoMesh * New()
static gmshGeoMesh * New()