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

Method SetName

Common/DataModel/vtkXMLDataElement.cxx:127–164  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

125
126//------------------------------------------------------------------------------
127void vtkXMLDataElement::SetName(const char* _arg)
128{
129 vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting Name to "
130 << (_arg ? _arg : "(null)"));
131
132 if (this->Name == nullptr && _arg == nullptr)
133 {
134 return;
135 }
136 if (this->Name && _arg && (!strcmp(this->Name, _arg)))
137 {
138 return;
139 }
140 delete[] this->Name;
141 this->IgnoreCharacterData = 0;
142 if (_arg)
143 {
144 // NOTE: Tags that have specialized character data
145 // handlers can set this flag to improve performance.
146 if (strstr(_arg, "DataArray"))
147 {
148 this->IgnoreCharacterData = 1;
149 }
150 size_t n = strlen(_arg) + 1;
151 char* cp1 = new char[n];
152 const char* cp2 = (_arg);
153 this->Name = cp1;
154 do
155 {
156 *cp1++ = *cp2++;
157 } while (--n);
158 }
159 else
160 {
161 this->Name = nullptr;
162 }
163 this->Modified();
164}
165
166//------------------------------------------------------------------------------
167void vtkXMLDataElement::SetCharacterData(const char* data, int length)

Callers 15

~vtkXMLDataElementMethod · 0.95
DeepCopyMethod · 0.95
GetSideSetArraysMethod · 0.45
InternalCopyAllocateMethod · 0.45
CommitSimplificationMethod · 0.45
CloseStreamMethod · 0.45
AllocateScalarsMethod · 0.45
GenerateGhostArrayMethod · 0.45
ComputeNormalsMethod · 0.45
InitializeArrayFunction · 0.45

Calls 2

GetClassNameMethod · 0.45
ModifiedMethod · 0.45

Tested by 15

RequestDataMethod · 0.36
RequestDataMethod · 0.36
RequestDataMethod · 0.36
RequestDataMethod · 0.36
GetGridFunction · 0.36
TestGraphDeletionFunction · 0.36
TestPolyDataRemoveCellFunction · 0.36
TestArrayListTemplateFunction · 0.36
TestSortFieldDataFunction · 0.36
TestPolyhedronDecomposeFunction · 0.36