[vtkusers] vtkMeshQuality Check, only one quality criteria is displayed at a time.. WHY?

Rakesh Patil rakeshthp at in.com
Mon Mar 1 23:37:14 EST 2010


 Hi,What a stupidity.. I should have done it last time itself.. Please excuse me for that.. So here it goes..vtkSmartPointer qualityMesh = vtkSmartPointer::New();qualityMesh>SetInput(uGrid);if(maxAngleQualityFlag){ qualityMesh>SetTriangleQualityMeasureToMaxAngle(); qualityMesh>Update(); vtkSmartPointer qualityArray = vtkDoubleArray::SafeDownCast( qualityMesh>GetOutput()>GetCellData()>GetArray("Quality"));qualityArray>SetName("qualityArr");vtkSmartPointer badcells = vtkSmartPointer::New();badcells>SetInput( qualityMesh>getOutput());badcells>ThresholdByUpper(120);badcells>SetInputArrayToProcess(0,0,0, vtkDataObject::FIELDASSOCIATIONCELLS, "qualityArr");badcells>Update();vtkSmartPointer mapp = vtkSmartPointer::New();mapp>SetInput(badcells>GetOutput());mapp>ScalarVisibilityOff();pRenderer>RemoveActor(maxAngleActor);maxAngleActor = vtkSmartPointer::New();maxAngleActor>SetMapper(mapp);maxAngleActor>GetProperty()>SetColor(0, 0, 1);maxAngleActor>GetProperty()>SetLineWidth(3);maxAngle
 Actor>GetProperty()>SetRepresentationToWireframe();pRenderer>AddActor(maxAngleActor);}if(minAngleQualityFlag) {qualityMesh>SetTriangleQualityMeasureToMinAngle();qualityMesh>Update(); vtkSmartPointer qualityArray =vtkDoubleArray::SafeDownCast( qualityMesh>GetOutput()>GetCellData()>GetArray("Quality")); qualityArray>SetName("qualityArr");vtkSmartPointer badcells =vtkSmartPointer::New(); badcells>SetInput( qualityMesh>getOutput()); badcells>ThresholdByLower(20); badcells>SetInputArrayToProcess(0,0,0,vtkDataObject::FIELDASSOCIATIONCELLS, "qualityArr"); badcells>Update();vtkSmartPointer mapp =vtkSmartPointer::New(); mapp>SetInput(badcells>GetOutput()); mapp>ScalarVisibilityOff();pRenderer>RemoveActor(minAngleActor); minAngleActor = vtkSmartPointer::New(); minAngleActor>SetMapper(mapp); minAngleActor>GetProperty()>SetColor(1, 0, 0); minAngleActor>GetProperty()>SetLineWidth(3); minAngleActor>GetProperty()>SetRepresentationToWireframe();pRenderer>AddActor(minAngleActor); }So in this
  case, the cells disqualifying min angle criteria will be visible, even if both flags are true. If i change the order of rendering..i.e. minAngle block first and then maxAngle block, then only cells disqualifying max angle criteria are only displayed. Can you figure out any mistake there??ThanksRegardsRakesh Patil Original message From:David Doria< daviddoria+vtk at gmail.com >Date: 01 Mar 10 18:25:55Subject:Re: [vtkusers] vtkMeshQuality Check, only one quality criteria is displayed at a time.. WHY?To: Rakesh Patil On Sun, Feb 28, 2010 at 11:20 PM, Rakesh Patilwrote: Hello,I am implementing the functionality of checking the mesh quality. As suggested by few of the seniors here in the mailing list, this is what i did:I passed the mesh data in the form of vtkUnstructuredGrid to the vtkMeshQuality. Then using the quality data array which we obtain from vtkMeshQuality's output, I use vtkThreshold class to get the elements which do not satisfy the requirement to be a good cell.I am 
 able to successfully represent the bad elements for a single quality parameter. But when i try to represent two quality parameters at the same time then, i can see only the one which is rendered at the end. for example, i have a GUI window where user can select what all quality parameter he wants to be displayed. Like, if user selects Minimum angle and maximum angle, both, then, all the elements that do not satisfy both criteria will be highlighted.In my case, I am selecting both min and max angle criteria and first I am highlighting bad element as for min angle and next I am highlighting max angle criteria. Now suppose, for min angle criteria, there are 10 bad cells. and for max angle criteria, there are only 2 bad cells, and these 2 cells are common in both criteria. SO i should get total 10 bad cell.. But in my case it is displaying only 2 bad cell for max angle quality. If i change the order of rendering then i see only 10 bad cells for min angle.So what do i have to do 
 to see both the quality criteria bad elements.??ThanksRegardsRakesh PatilYou'll have to show us exactly how you are trying to do this. Are you using two separate vtkMeshQuality filters? Two separate actors for highlighting? Maybe you can post the smallest compilable piece of code that demonstrates your problem. Thanks,David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100302/68fd51f7/attachment.htm>


More information about the vtkusers mailing list