From: ski Date: Thu, 6 Oct 2016 09:30:39 +0000 (+0300) Subject: 0027905: Visualization - randomly directed arrows on test v3d mesh B7 X-Git-Tag: V7_1_0_beta~101 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=90b858262b5572171a52df967bdb7fc8d507cab1;p=occt-copy.git 0027905: Visualization - randomly directed arrows on test v3d mesh B7 Behaviour of command meshvectors is stable now. It shows default vector (0,0,1) for volume entity. Test cases for issue CR27905 --- diff --git a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx index 43e5d31787..c7e9818cd2 100644 --- a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx +++ b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx @@ -965,9 +965,11 @@ static Standard_Integer meshvectors( Draw_Interpretor& di, for ( ; anIter.More(); anIter.Next() ) { Standard_Boolean IsValidData = Standard_False; - if (anIsElement) - IsValidData = aMesh->GetDataSource()->GetNormal(anIter.Key(), 3, aCoords.ChangeValue(1), aCoords.ChangeValue(2), aCoords.ChangeValue(3)); - else + if (anIsElement) { + aMesh->GetDataSource()->GetGeomType(anIter.Key(), anIsElement, aEntType); + if (aEntType == MeshVS_ET_Face) + IsValidData = aMesh->GetDataSource()->GetNormal(anIter.Key(), 3, aCoords.ChangeValue(1), aCoords.ChangeValue(2), aCoords.ChangeValue(3)); + } else IsValidData = aMesh->GetDataSource()->GetGeom(anIter.Key(), Standard_False, aCoords, aNbNodes, aEntType); gp_Vec aNorm; diff --git a/tests/bugs/demo/bug27905 b/tests/bugs/demo/bug27905 new file mode 100755 index 0000000000..6565838f34 --- /dev/null +++ b/tests/bugs/demo/bug27905 @@ -0,0 +1,24 @@ +puts "============" +puts "CR27905" +puts "============" +puts "" +########################################################################################################## +# Visualization - randomly directed arrows on test v3d mesh B7 +########################################################################################################## + +pload XSDRAW + +vinit +vclear + +mesh3delem m +vsetdispmode m 5 + +meshvectors m -mode elem -maxlen 10 -color green -arrowpart 0.5 -issipmle 0 +vdump ${imagedir}/${test_image}_1.png + +meshvectors m -mode elem -maxlen 10 -color green -arrowpart 0.5 -issipmle 0 +vdump ${imagedir}/${test_image}_2.png + +meshvectors m -mode elem -maxlen 10 -color green -arrowpart 0.5 -issipmle 0 +vdump ${imagedir}/${test_image}_3.png