// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
vtkStandardNewMacro(vtkExtractGroup);
-vtkCxxSetObjectMacro(vtkExtractGroup, SIL, vtkMutableDirectedGraph);
-
///////////////////
class ExtractGroupStatus
public:
void loadFrom(vtkMutableDirectedGraph *sil);
int getNumberOfEntries() const;
+ const char *getMeshName() const;
const char *getKeyOfEntry(int i) const;
bool getStatusOfEntryStr(const char *entry) const;
void setStatusOfEntryStr(const char *entry, bool status);
private:
std::vector<ExtractGroupGrp> _groups;
std::vector<ExtractGroupFam> _fams;
+ std::string _mesh_name;
};
const char ExtractGroupGrp::START[]="GRP_";
return false;
}
+const char *vtkExtractGroup::vtkExtractGroupInternal::getMeshName() const
+{
+ return this->_mesh_name.c_str();
+}
+
void vtkExtractGroup::vtkExtractGroupInternal::loadFrom(vtkMutableDirectedGraph *sil)
{
std::vector<ExtractGroupGrp> oldGrps(_groups); _groups.clear();
{
vtkIdType id1(it0->Next());
std::string meshName((const char *)verticesNames2->GetValue(id1));
+ this->_mesh_name=meshName;
vtkAdjacentVertexIterator *it1(vtkAdjacentVertexIterator::New());
sil->GetAdjacentVertices(id1,it1);
vtkIdType idZeGrps(it1->Next());//zeGroups
int vtkExtractGroup::RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
+ vtkUnstructuredGridAlgorithm::RequestInformation(request,inputVector,outputVector);
try
{
//std::cerr << "########################################## vtkExtractGroup::RequestInformation ##########################################" << std::endl;
return 1;
}
+/*!
+ * Do not use vtkCxxSetObjectMacro macro because input mdg comes from an already managed in the pipeline just a ref on it.
+ */
+void vtkExtractGroup::SetSIL(vtkMutableDirectedGraph *mdg)
+{
+ if(this->SIL==mdg)
+ return ;
+ this->SIL=mdg;
+}
+
template<class CellPointExtractor>
vtkDataSet *FilterFamilies(vtkDataSet *input, const std::set<int>& idsToKeep, bool insideOut, const char *arrNameOfFamilyField,
const char *associationForThreshold, bool& catchAll, bool& catchSmth)
}
else
{
- vtkDataSet *tryOnNode(FilterFamilies<PointExtractor>(tryOnCell,idsToKeep,this->InsideOut,
+ vtkDataSet *tryOnNode(FilterFamilies<PointExtractor>(input,idsToKeep,this->InsideOut,
MEDFileFieldRepresentationLeavesArrays::FAMILY_ID_NODE_NAME,"vtkDataObject::FIELD_ASSOCIATION_POINTS",catchAll,catchSmth));
if(tryOnNode)
{
this->Modified();
//this->Internal->printMySelf(std::cerr);
}
+
+const char *vtkExtractGroup::GetMeshName()
+{
+ return this->Internal->getMeshName();
+}