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

Method InitWithCell

Testing/GenericBridge/vtkBridgeCell.cxx:909–935  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Used internally for the Bridge. Initialize the cell from a cell `c' and an `id'. \pre c_exists: c!=0

Source from the content-addressed store, hash-verified

907// Initialize the cell from a cell `c' and an `id'.
908// \pre c_exists: c!=0
909void vtkBridgeCell::InitWithCell(vtkCell* c, vtkIdType id)
910{
911 assert("pre: c_exists" && c != nullptr);
912
913 vtkSetObjectBodyMacro(DataSet, vtkBridgeDataSet, static_cast<vtkBridgeDataSet*>(nullptr));
914 this->Id = id;
915
916 // warning: do directly vtkSetObjectBodyMacro(Cell,vtkCell,c->NewInstance())
917 // add memory leak because the text "c->NewInstance()" is copied several
918 // time in the macro...
919
920 if (this->Cell)
921 {
922 this->Cell->Delete();
923 }
924 this->Cell = c->NewInstance();
925
926 this->Cell->DeepCopy(c);
927 this->BoolIsInDataSet = 0;
928
929 if (this->InternalIterator == nullptr)
930 {
931 this->InternalIterator = vtkBridgeCellIterator::New();
932 }
933 this->InternalIterator->InitWithOneCell(this);
934 this->InternalIterator->Begin();
935}
936
937//------------------------------------------------------------------------------
938// Description:

Callers 4

GetCellMethod · 0.45
InitWithPointsMethod · 0.45
GetCellMethod · 0.45
GetPointIteratorMethod · 0.45

Calls 7

DeleteMethod · 0.65
assertFunction · 0.50
NewFunction · 0.50
NewInstanceMethod · 0.45
DeepCopyMethod · 0.45
InitWithOneCellMethod · 0.45
BeginMethod · 0.45

Tested by

no test coverage detected