|
VTK
9.6.20260329
|
list of point or cell ids More...
#include <vtkIdList.h>
Public Types | |
| enum | DeleteMethod { VTK_DATA_ARRAY_FREE = vtkAbstractArray::VTK_DATA_ARRAY_FREE , VTK_DATA_ARRAY_DELETE = vtkAbstractArray::VTK_DATA_ARRAY_DELETE , VTK_DATA_ARRAY_ALIGNED_FREE = vtkAbstractArray::VTK_DATA_ARRAY_ALIGNED_FREE , VTK_DATA_ARRAY_USER_DEFINED = vtkAbstractArray::VTK_DATA_ARRAY_USER_DEFINED } |
Public Member Functions | |
| void | Initialize () |
| Release memory and restore to unallocated state. | |
| vtkTypeBool | Allocate (vtkIdType size, int strategy=0) |
| Allocate memory for this id list. | |
| vtkTypeBool | Reserve (vtkIdType size) |
| Reserve the id list to the requested number of ids and preserve data. | |
| vtkIdType | GetNumberOfIds () const noexcept |
| Return the number of id's in the list. | |
| vtkIdType | GetId (vtkIdType i) |
| Return the id at location i. | |
| vtkIdType | FindIdLocation (const vtkIdType id) |
| Find the location i of the provided id. | |
| void | SetNumberOfIds (vtkIdType number) |
| Specify the number of ids for this object to hold. | |
| void | SetId (vtkIdType i, vtkIdType id) |
| Set the id at location i. | |
| void | InsertId (vtkIdType i, vtkIdType id) |
| Set the id at location i. | |
| vtkIdType | InsertNextId (vtkIdType id) |
| Add the id specified to the end of the list. | |
| vtkIdType | InsertUniqueId (vtkIdType id) |
| If id is not already in list, insert it and return location in list. | |
| void | Sort () |
| Sort the ids in the list in ascending id order. | |
| void | Fill (vtkIdType value) |
| Fill the ids with the input value. | |
| vtkIdType * | GetPointer (vtkIdType i) |
| Get a pointer to a particular data index. | |
| vtkIdType * | WritePointer (vtkIdType i, vtkIdType number) |
| Get a pointer to a particular data index. | |
| void | SetList (vtkIdType *array, vtkIdType size, bool save, int deleteMethod=VTK_DATA_ARRAY_DELETE) |
| This method let's the user specify data to be held by the id list. | |
| void | SetArray (vtkIdType *array, vtkIdType size, bool manageMemory=true) |
| This method does the same as SetList but the save and manageMemory are opposite. | |
| void | Reset () |
| Reset to an empty state but retain previously allocated memory. | |
| void | Squeeze () |
| Free any unused memory. | |
| void | ShallowCopy (vtkIdList *list) |
| Copy an id list by copying the internal buffer pointer. | |
| void | DeepCopy (vtkIdList *ids) |
| Copy an id list by explicitly copying the internal array. | |
| void | DeleteId (vtkIdType id) |
| Delete specified id from list. | |
| vtkIdType | IsId (vtkIdType id) VTK_FUTURE_CONST |
| Return -1 if id specified is not contained in the list; otherwise return the position in the list. | |
| void | IntersectWith (vtkIdList *otherIds) |
| Intersect this list with another vtkIdList. | |
| vtkIdType * | Resize (vtkIdType sz) |
| Adjust the size of the id list while maintaining its content (except when being truncated). | |
| vtkIdType * | Release () |
| This releases the ownership of the internal vtkIdType array and returns the pointer to it. | |
| vtkIdType | GetCapacity () const |
| Get the capacity of the id list. | |
| vtkIdType * | begin () |
To support range-based for loops. | |
| vtkIdType * | end () |
To support range-based for loops. | |
| const vtkIdType * | begin () const |
To support range-based for loops. | |
| const vtkIdType * | end () const |
To support range-based for loops. | |
Public Member Functions inherited from vtkObject | |
| vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
| virtual void | DebugOn () |
| Turn debugging output on. | |
| virtual void | DebugOff () |
| Turn debugging output off. | |
| bool | GetDebug () |
| Get the value of the debug flag. | |
| void | SetDebug (bool debugFlag) |
| Set the value of the debug flag. | |
| virtual void | Modified () |
| Update the modification time for this object. | |
| virtual vtkMTimeType | GetMTime () |
| Return this object's modified time. | |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| Methods invoked by print to print information about the object including superclasses. | |
| void | RemoveObserver (unsigned long tag) |
| void | RemoveObservers (unsigned long event) |
| void | RemoveObservers (const char *event) |
| void | RemoveAllObservers () |
| vtkTypeBool | HasObserver (unsigned long event) |
| vtkTypeBool | HasObserver (const char *event) |
| vtkTypeBool | InvokeEvent (unsigned long event) |
| vtkTypeBool | InvokeEvent (const char *event) |
| std::string | GetObjectDescription () const override |
| The object description printed in messages and PrintSelf output. | |
| unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| vtkCommand * | GetCommand (unsigned long tag) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| void | RemoveObserver (vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| void | RemoveObservers (unsigned long event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| void | RemoveObservers (const char *event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| template<class U, class T> | |
| unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
| Overloads to AddObserver that allow developers to add class member functions as callbacks for events. | |
| template<class U, class T> | |
| unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
| Overloads to AddObserver that allow developers to add class member functions as callbacks for events. | |
| template<class U, class T> | |
| unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
| Allow user to set the AbortFlagOn() with the return value of the callback method. | |
| vtkTypeBool | InvokeEvent (unsigned long event, void *callData) |
| This method invokes an event and return whether the event was aborted or not. | |
| vtkTypeBool | InvokeEvent (const char *event, void *callData) |
| This method invokes an event and return whether the event was aborted or not. | |
| virtual void | SetObjectName (const std::string &objectName) |
| Set/get the name of this object for reporting purposes. | |
| virtual std::string | GetObjectName () const |
| Set/get the name of this object for reporting purposes. | |
Public Member Functions inherited from vtkObjectBase | |
| const char * | GetClassName () const |
| Return the class name as a string. | |
| virtual vtkIdType | GetNumberOfGenerationsFromBase (const char *name) |
| Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
| virtual void | Delete () |
| Delete a VTK object. | |
| virtual void | FastDelete () |
| Delete a reference to this object. | |
| void | InitializeObjectBase () |
| void | Print (ostream &os) |
| Print an object to an ostream. | |
| void | Register (vtkObjectBase *o) |
| Increase the reference count (mark as used by another object). | |
| virtual void | UnRegister (vtkObjectBase *o) |
| Decrease the reference count (release by another object). | |
| int | GetReferenceCount () |
| Return the current reference count of this object. | |
| void | SetReferenceCount (int) |
| Sets the reference count. | |
| bool | GetIsInMemkind () const |
| A local state flag that remembers whether this object lives in the normal or extended memory space. | |
| virtual void | PrintHeader (ostream &os, vtkIndent indent) |
| Methods invoked by print to print information about the object including superclasses. | |
| virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
| Methods invoked by print to print information about the object including superclasses. | |
| virtual bool | UsesGarbageCollector () const |
Indicate whether the class uses vtkGarbageCollector or not. | |
Protected Member Functions | |
| vtkIdList () | |
| ~vtkIdList () override | |
| bool | AllocateInternal (vtkIdType sz, vtkIdType numberOfIds) |
| Allocate ids and set the number of ids. | |
| void | InitializeMemory () |
| Release memory. | |
Protected Member Functions inherited from vtkObject | |
| vtkObject () | |
| ~vtkObject () override | |
| void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
| void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
| void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr) |
| These methods allow a command to exclusively grab all events. | |
| void | InternalReleaseFocus () |
| These methods allow a command to exclusively grab all events. | |
Protected Member Functions inherited from vtkObjectBase | |
| vtkObjectBase () | |
| virtual | ~vtkObjectBase () |
| virtual void | ReportReferences (vtkGarbageCollector *) |
| vtkObjectBase (const vtkObjectBase &) | |
| void | operator= (const vtkObjectBase &) |
Protected Attributes | |
| vtkIdType | NumberOfIds |
| vtkBuffer< vtkIdType > * | Buffer |
| vtkIdType | Size |
Protected Attributes inherited from vtkObject | |
| bool | Debug |
| vtkTimeStamp | MTime |
| vtkSubjectHelper * | SubjectHelper |
| std::string | ObjectName |
Protected Attributes inherited from vtkObjectBase | |
| std::atomic< int32_t > | ReferenceCount |
| vtkWeakPointerBase ** | WeakPointers |
| typedef vtkObject | Superclass |
| Standard methods for instantiation, type information, and printing. | |
| static vtkIdList * | New () |
| Standard methods for instantiation, type information, and printing. | |
| static vtkTypeBool | IsTypeOf (const char *type) |
| Standard methods for instantiation, type information, and printing. | |
| static vtkIdList * | SafeDownCast (vtkObjectBase *o) |
| Standard methods for instantiation, type information, and printing. | |
| virtual vtkTypeBool | IsA (const char *type) |
| Standard methods for instantiation, type information, and printing. | |
| vtkIdList * | NewInstance () const |
| Standard methods for instantiation, type information, and printing. | |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| Standard methods for instantiation, type information, and printing. | |
| virtual vtkObjectBase * | NewInstanceInternal () const |
| Standard methods for instantiation, type information, and printing. | |
Additional Inherited Members | |
Static Public Member Functions inherited from vtkObject | |
| static vtkObject * | New () |
| Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
| static void | BreakOnError () |
| This method is called when vtkErrorMacro executes. | |
| static void | SetGlobalWarningDisplay (vtkTypeBool val) |
| This is a global flag that controls whether any debug, warning or error messages are displayed. | |
| static void | GlobalWarningDisplayOn () |
| This is a global flag that controls whether any debug, warning or error messages are displayed. | |
| static void | GlobalWarningDisplayOff () |
| This is a global flag that controls whether any debug, warning or error messages are displayed. | |
| static vtkTypeBool | GetGlobalWarningDisplay () |
| This is a global flag that controls whether any debug, warning or error messages are displayed. | |
Static Public Member Functions inherited from vtkObjectBase | |
| static vtkTypeBool | IsTypeOf (const char *name) |
| Return 1 if this class type is the same type of (or a subclass of) the named class. | |
| static vtkIdType | GetNumberOfGenerationsFromBaseType (const char *name) |
| Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
| static vtkObjectBase * | New () |
| Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
| static void | SetMemkindDirectory (const char *directoryname) |
| The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. | |
| static bool | GetUsingMemkind () |
| A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. | |
Static Protected Member Functions inherited from vtkObjectBase | |
| static vtkMallocingFunction | GetCurrentMallocFunction () |
| static vtkReallocingFunction | GetCurrentReallocFunction () |
| static vtkFreeingFunction | GetCurrentFreeFunction () |
| static vtkFreeingFunction | GetAlternateFreeFunction () |
list of point or cell ids
vtkIdList is used to represent and pass data id's between objects. vtkIdList may represent any type of integer id, but usually represents point and cell ids.
Definition at line 134 of file vtkIdList.h.
| typedef vtkObject vtkIdList::Superclass |
Standard methods for instantiation, type information, and printing.
Definition at line 150 of file vtkIdList.h.
| Enumerator | |
|---|---|
| VTK_DATA_ARRAY_FREE | |
| VTK_DATA_ARRAY_DELETE | |
| VTK_DATA_ARRAY_ALIGNED_FREE | |
| VTK_DATA_ARRAY_USER_DEFINED | |
Definition at line 137 of file vtkIdList.h.
|
protected |
|
overrideprotected |
|
static |
Standard methods for instantiation, type information, and printing.
|
static |
Standard methods for instantiation, type information, and printing.
|
virtual |
Standard methods for instantiation, type information, and printing.
Reimplemented from vtkObjectBase.
|
static |
Standard methods for instantiation, type information, and printing.
|
protectedvirtual |
Standard methods for instantiation, type information, and printing.
| vtkIdList * vtkIdList::NewInstance | ( | ) | const |
Standard methods for instantiation, type information, and printing.
|
overridevirtual |
Standard methods for instantiation, type information, and printing.
Reimplemented from vtkObjectBase.
| void vtkIdList::Initialize | ( | ) |
Release memory and restore to unallocated state.
| vtkTypeBool vtkIdList::Allocate | ( | vtkIdType | size, |
| int | strategy = 0 ) |
Allocate memory for this id list.
Delete old storage only if necessary. Note that strategy is no longer used. This method will reset NumberOfIds to 0 and change the id list's capacity such that this->Capacity >= size. If size is 0, all memory will be freed. Return 1 on success, 0 on failure.
| vtkTypeBool vtkIdList::Reserve | ( | vtkIdType | size | ) |
Reserve the id list to the requested number of ids and preserve data.
Increasing the id list capacity may allocate extra memory beyond what was requested. NumberOfIds will not be modified when increasing id list size.
Decreasing the id list capacity is effectively a no-op.
Returns 1 if resizing succeeded and 0 otherwise.
|
inlinenoexcept |
Return the number of id's in the list.
Definition at line 185 of file vtkIdList.h.
Return the id at location i.
Definition at line 190 of file vtkIdList.h.
Find the location i of the provided id.
Definition at line 198 of file vtkIdList.h.
| void vtkIdList::SetNumberOfIds | ( | vtkIdType | number | ) |
Specify the number of ids for this object to hold.
Does an allocation as well as setting the number of ids. Preserves existing data.
Set the id at location i.
Doesn't do range checking so it's a bit faster than InsertId. Make sure you use SetNumberOfIds() to allocate memory prior to using SetId().
Definition at line 222 of file vtkIdList.h.
Set the id at location i.
Does range checking and allocates memory as necessary.
Definition at line 387 of file vtkIdList.h.
Add the id specified to the end of the list.
Range checking is performed.
Definition at line 401 of file vtkIdList.h.
If id is not already in list, insert it and return location in list.
Otherwise return just location in list.
| void vtkIdList::Sort | ( | ) |
Sort the ids in the list in ascending id order.
This method uses vtkSMPTools::Sort() so it can be sped up if built properly.
| void vtkIdList::Fill | ( | vtkIdType | value | ) |
Fill the ids with the input value.
This method uses vtkSMPTools::Fill() so it can be sped up if built properly.
Get a pointer to a particular data index.
Definition at line 259 of file vtkIdList.h.
Get a pointer to a particular data index.
Make sure data is allocated for the number of items requested. Set MaxId according to the number of data values requested.
| void vtkIdList::SetList | ( | vtkIdType * | array, |
| vtkIdType | size, | ||
| bool | save, | ||
| int | deleteMethod = VTK_DATA_ARRAY_DELETE ) |
This method let's the user specify data to be held by the id list.
The array argument is a pointer to the data. Size is the size of the array supplied by the user (as number of ids, not in bytes). Set save to 1 to prevent the class from deleting the array when it cleans up or reallocates memory. The class uses the actual array provided; it does not copy the data from the supplied array. If specified, the delete method determines how the data array will be deallocated. If the delete method is VTK_DATA_ARRAY_FREE, free() will be used. If the delete method is VTK_DATA_ARRAY_DELETE, delete[] will be used. If the delete method is VTK_DATA_ARRAY_ALIGNED_FREE _aligned_free() will be used on Windows, while free() will be used everywhere else. The default is VTK_DATA_ARRAY_DELETE.
This method does the same as SetList but the save and manageMemory are opposite.
It was deprecated to promote uniformity between vtkIdList and vtkAOSDataArrayTemplate APIs.
|
inline |
Reset to an empty state but retain previously allocated memory.
Definition at line 295 of file vtkIdList.h.
| void vtkIdList::Squeeze | ( | ) |
Free any unused memory.
| void vtkIdList::ShallowCopy | ( | vtkIdList * | list | ) |
Copy an id list by copying the internal buffer pointer.
Note that this is a shallow copy, so the internal buffer is shared between the two id lists.
| void vtkIdList::DeepCopy | ( | vtkIdList * | ids | ) |
Copy an id list by explicitly copying the internal array.
| void vtkIdList::DeleteId | ( | vtkIdType | id | ) |
Delete specified id from list.
Will remove all occurrences of id in list.
Return -1 if id specified is not contained in the list; otherwise return the position in the list.
Definition at line 414 of file vtkIdList.h.
| void vtkIdList::IntersectWith | ( | vtkIdList * | otherIds | ) |
Intersect this list with another vtkIdList.
Updates current list according to result of intersection operation.
Adjust the size of the id list while maintaining its content (except when being truncated).
| vtkIdType * vtkIdList::Release | ( | ) |
|
inline |
Get the capacity of the id list.
This returns the number of id slots in the id list's allocated storage.
Definition at line 351 of file vtkIdList.h.
|
inline |
To support range-based for loops.
Definition at line 357 of file vtkIdList.h.
|
inline |
To support range-based for loops.
Definition at line 358 of file vtkIdList.h.
|
inline |
To support range-based for loops.
Definition at line 359 of file vtkIdList.h.
|
inline |
To support range-based for loops.
Definition at line 360 of file vtkIdList.h.
Allocate ids and set the number of ids.
|
protected |
Release memory.
|
protected |
Definition at line 377 of file vtkIdList.h.
Definition at line 378 of file vtkIdList.h.
|
protected |
Definition at line 379 of file vtkIdList.h.