vtkCellGridCopyQuery

Struct vtkCellGridCopyQuery 

Source
pub struct vtkCellGridCopyQuery(/* private fields */);
Expand description

Copy the cell metadata and attribute(s) of one cell-grid into another.

Note that this query is run by vtkCellGrid::ShallowCopy(), vtkCellGrid::DeepCOpy(), and vtkCellGrid::CopyStructure().

In general, there are five types of information in cell grids that may be transferred from the source cell-grid to the target. Here are the types of information and the options which control how that information is copied. Exactly how these flags on the query are used is up to each responder.

  • Cell metadata records. These records are always copied. In the future, there may be an option to omit cells of specific types.

  • Individual cells. If subclasses of vtkCellMetadata contain further information, you may use SetCopyCells() to control whether that is copied or whether the new vtkCellMetadata instance is left uninitialized. When GetCopyCells() is enabled, the cell topology should be copied (though not necessarily the shape attribute’s arrays); CopyCells overrides the copying of topological arrays even if CopyArrays is turned off. This way, if CopyCells is on, you should expect the source and target to report the same number of cells.

  • Cell attributes. You may request that only the shape attribute is copied from the source to the target with CopyOnlyShapeOn() or control which attributes are copied by calling AddSourceCellAttributeId() with the ID of each source attribute you wish copied.

  • Cell-attribute arrays. For each cell-attribute that is copied, zero or more arrays may be associated the attribute. You can control how the arrays are copied like so:

  • SetCopyArrays() controls whether arrays should be created or not. How the arrays are copied depends on whether CopyArrayValues and DeepCopyArrays are enabled. Note that this setting should be ignored when copying cell topology (as opposed to attribute) arrays as CopyCells should control whether cells are present in the output. If cell-topology arrays are referenced by a cell attribute, be aware that disabling CopyArrays may still produce some entries for topology arrays.

  • SetCopyArrayValues() controls whether arrays should be (a) created but left empty or (b) created and populated with the source-array’s values. This is useful for creating an empty copy that has all the necessary arrays prepared but no tuples so that further processing can insert new cells and attribute data.

  • SetDeepCopyArrays() controls whether to create deep copies of arrays or shallow copies, but only when GetCopyArrayValues() returns true.

  • Schema and content version. A cell-grid may advertise that its data adheres to a formal specification (which is indicated by a name and version number). If you wish to copy this information, ensure CopySchemaOn() has been called. If GetCopySchema() is true and the source has a content version number, the target cell-grid will have its content version incremented past the source’s content version. Incrementing the content version even when the grids are otherwise identical improves track-ability, since the version number informs which grid preceded the other.

§For Callers

You must execute this query on the source cell-grid, not the target. Only the source is guaranteed to have cells of the proper types present; the query iterates over each cell-type, so they must be present.

Executing this query will overwrite the target cell-grid with the source, erasing all of its cell metadata. In the future, this class may offer more control over which types of cells to copy from the source to the target.

§For Responders

Responders to this query may call the helper methods provided to copy a cell-attribute’s arrays and create/update a cell-attribute. These calls update maps from source to target arrays and attributes, which you can inspect by calling GetArrayMap() and GetAttributeMap(), respectively. The latter is important since distinct attributes may have identical names (though this is not advised).

Implementations§

Source§

impl vtkCellGridCopyQuery

Source

pub fn new() -> Self

Creates a new vtkCellGridCopyQuery wrapped inside vtkNew

Trait Implementations§

Source§

impl Default for vtkCellGridCopyQuery

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for vtkCellGridCopyQuery

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.