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

Method GetWordTypeAttribute

Common/DataModel/vtkXMLDataElement.cxx:804–932  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

802
803//------------------------------------------------------------------------------
804int vtkXMLDataElement::GetWordTypeAttribute(const char* name, int& value)
805{
806 // These string values must match vtkXMLWriter::GetWordTypeName().
807 const char* v = this->GetAttribute(name);
808 if (!v)
809 {
810 vtkErrorMacro("Missing word type attribute \"" << name << "\".");
811 return 0;
812 }
813 else if (strcmp(v, "Float32") == 0)
814 {
815#ifdef VTK_TYPE_FLOAT32
816 value = VTK_TYPE_FLOAT32;
817 return 1;
818#else
819 vtkErrorMacro("Float32 support not compiled in VTK.");
820 return 0;
821#endif
822 }
823 else if (strcmp(v, "Float64") == 0)
824 {
825#ifdef VTK_TYPE_FLOAT64
826 value = VTK_TYPE_FLOAT64;
827 return 1;
828#else
829 vtkErrorMacro("Float64 support not compiled in VTK.");
830 return 0;
831#endif
832 }
833 else if (strcmp(v, "Int8") == 0)
834 {
835#ifdef VTK_TYPE_INT8
836 value = VTK_TYPE_INT8;
837 return 1;
838#else
839 vtkErrorMacro("Int8 support not compiled in VTK.");
840 return 0;
841#endif
842 }
843 else if (strcmp(v, "UInt8") == 0)
844 {
845#ifdef VTK_TYPE_UINT8
846 value = VTK_TYPE_UINT8;
847 return 1;
848#else
849 vtkErrorMacro("UInt8 support not compiled in VTK.");
850 return 0;
851#endif
852 }
853 else if (strcmp(v, "Int16") == 0)
854 {
855#ifdef VTK_TYPE_INT16
856 value = VTK_TYPE_INT16;
857 return 1;
858#else
859 vtkErrorMacro("Int16 support not compiled in VTK.");
860 return 0;
861#endif

Callers 2

CreateArrayMethod · 0.80
SetFieldDataInfoMethod · 0.80

Calls 1

GetAttributeMethod · 0.95

Tested by

no test coverage detected