MCPcopy Create free account
hub / github.com/Kitware/VTK / GetNumberOfVerticesOnFace

Method GetNumberOfVerticesOnFace

Testing/GenericBridge/vtkBridgeCell.cxx:754–818  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Return the number of vertices defining face `faceId' \pre is_3d: this->GetDimension()==3 \pre valid_faceId_range: faceId>=0 && faceId GetNumberOfBoundaries(2) \post positive_result: && result>0

Source from the content-addressed store, hash-verified

752// \pre valid_faceId_range: faceId>=0 && faceId<this->GetNumberOfBoundaries(2)
753// \post positive_result: && result>0
754int vtkBridgeCell::GetNumberOfVerticesOnFace(int faceId)
755{
756 assert("pre: is_3d" && this->GetDimension() == 3);
757 assert("pre: valid_faceId_range" && faceId >= 0 && faceId < this->GetNumberOfBoundaries(2));
758
759 int result = 0;
760
761 switch (this->GetType())
762 {
763 case VTK_HIGHER_ORDER_TETRAHEDRON:
764 result = 3;
765 break;
766 case VTK_HIGHER_ORDER_HEXAHEDRON:
767 result = 4;
768 break;
769 case VTK_HIGHER_ORDER_WEDGE:
770 if (faceId <= 1) // triangle face
771 {
772 result = 3;
773 }
774 else // quad face
775 {
776 result = 4;
777 }
778 break;
779 case VTK_HIGHER_ORDER_PYRAMID:
780 if (faceId == 0) // base
781 {
782 result = 4;
783 }
784 else // side
785 {
786 result = 3;
787 }
788 break;
789#if 0 // TODO
790 case VTK_PENTAGONAL_PRISM:
791 if(faceId<=1)
792 {
793 result=4;
794 }
795 else
796 {
797 result=3;
798 }
799 break;
800 case VTK_HEXAGONAL_PRISM:
801 if(faceId<=1)
802 {
803 result=6;
804 }
805 else
806 {
807 result=4;
808 }
809 break;
810#endif
811 default:

Callers 2

TessellateFaceMethod · 0.80
TriangulateFaceMethod · 0.80

Calls 4

GetDimensionMethod · 0.95
GetNumberOfBoundariesMethod · 0.95
GetTypeMethod · 0.95
assertFunction · 0.50

Tested by

no test coverage detected