|
VTK
9.7.20261004
|
#include <vtkCellGridToUnstructuredGrid.h>
A query corresponding to this algorithm.
This query gets run on the input cell-grid.
Definition at line 66 of file vtkCellGridToUnstructuredGrid.h.
Classes | |
| struct | OutputAllocation |
| A placeholder for space to be occupied in a vtkCellArray. More... | |
Public Types | |
| enum | PassType : int { CountOutputs = 0 , GenerateSamples , GenerateConnectivity , GeneratePointData = 3 } |
| Passes performed by the query. More... | |
| typedef vtkCellGridQuery | Superclass |
| using | OutputAllocations = std::unordered_map<vtkStringToken, OutputAllocation> |
| A map used to allocate space for the unstructured-grid's vtkCellArray. | |
| using | ConnectivityCountType = std::vector<std::atomic<int>> |
| How many samples were merged into each output point. | |
| using | ConnectivityWeightType = std::vector<float> |
| The reciprocal of the number of samples merged into each output point. | |
| Public Types inherited from vtkCellGridQuery | |
| typedef vtkObject | Superclass |
Public Member Functions | |
| virtual vtkTypeBool | IsA (const char *type) |
| Return 1 if this class is the same type of (or a subclass of) the named class. | |
| vtkCellGridToUnstructuredGrid::Query * | NewInstance () const |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| Methods invoked by print to print information about the object including superclasses. | |
| bool | Initialize () override |
| Override this if your query-result state requires initialization. | |
| void | StartPass () override |
| Mark the start of a pass through each cell type. | |
| bool | Finalize () override |
| Override this if your query-result state requires finalization. | |
| bool | IsAborted () |
| Return true if the user has asked the filter to stop. | |
| vtkIdType | GetSubdivisionCount () const |
| Return the number of subdivisions along each parametric axis. | |
| bool | IsAnotherPassRequired () override |
| Force one pass per PassType through this query. | |
| vtkUnstructuredGrid * | GetOutput () const |
| Get the request's output cell-grid. | |
| vtkCellGrid * | GetInput () const |
| Get the request's input cell-grid. | |
| OutputAllocations & | GetOutputAllocations () |
| Return the data structure used in the CountOutputs pass. | |
| const OutputAllocations & | GetOutputAllocations () const |
| vtkDataArray * | GetOutputArray (vtkCellAttribute *inputAttribute) |
| Return an output attribute (or null). | |
| vtkDoubleArray * | GetSampleCoordinates () |
| Return the array holding one candidate output point per sample. | |
| vtkIdTypeArray * | GetSampleToPoint () |
| Map a sample index to the output point the sample was merged into. | |
| ConnectivityWeightType & | GetConnectivityWeights () |
| virtual void | SetSubdivisionLevel (int) |
| virtual int | GetSubdivisionLevel () |
| virtual void | SetPointMergeTolerance (double) |
| virtual double | GetPointMergeTolerance () |
| Public Member Functions inherited from vtkCellGridQuery | |
| vtkCellGridQuery * | NewInstance () const |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| Methods invoked by print to print information about the object including superclasses. | |
| virtual int | GetPass () |
| Return the current pass (the number of times each responder has been evaluated so far). | |
| 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. | |
Static Public Member Functions | |
| static Query * | New () |
| static vtkTypeBool | IsTypeOf (const char *type) |
| static vtkCellGridToUnstructuredGrid::Query * | SafeDownCast (vtkObjectBase *o) |
| Static Public Member Functions inherited from vtkCellGridQuery | |
| static vtkTypeBool | IsTypeOf (const char *type) |
| static vtkCellGridQuery * | SafeDownCast (vtkObjectBase *o) |
| 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. | |
Protected Member Functions | |
| virtual vtkObjectBase * | NewInstanceInternal () const |
| Query ()=default | |
| ~Query () override=default | |
| void | MergeSamplesIntoPoints () |
| Merge coincident samples and allocate the output points they became. | |
| Protected Member Functions inherited from vtkCellGridQuery | |
| vtkCellGridQuery ()=default | |
| ~vtkCellGridQuery () override=default | |
| 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 | |
| vtkCellGrid * | Input { nullptr } |
| vtkUnstructuredGrid * | Output { nullptr } |
| int | SubdivisionLevel { 0 } |
| How many times each cell is halved per axis (see SetSubdivisionLevel()). | |
| double | PointMergeTolerance { 1e-12 } |
| The relative distance within which samples merge (see SetPointMergeTolerance()). | |
| vtkCellGridToUnstructuredGrid * | Algorithm { nullptr } |
| The algorithm running this query, used only to poll for an abort. | |
| OutputAllocations | OutputOffsets |
| Map output cell-typename to input cell-typename to count (offset after the AllocateOutputs pass has run). | |
| std::unordered_map< vtkCellAttribute *, vtkDataArray * > | AttributeMap |
| vtkNew< vtkDoubleArray > | SampleCoordinates |
| One candidate output point per sample, before coincident ones merge. | |
| vtkNew< vtkIdTypeArray > | SampleToPoint |
| The output point each sample was merged into. | |
| ConnectivityCountType | ConnectivityCount |
| The number of samples merged into each output point. | |
| ConnectivityWeightType | ConnectivityWeights |
| The reciprocal of every entry in ConnectivityCount. | |
| vtkIdType | TotalCells { 0 } |
| Totals over every cell type, accumulated with the offsets below. | |
| vtkIdType | TotalConnectivityIds { 0 } |
| vtkNew< vtkIdTypeArray > | CellArrayOffsets |
| Storage handed to the output vtkCellArray, written by index. | |
| vtkNew< vtkIdTypeArray > | CellArrayConnectivity |
| Protected Attributes inherited from vtkCellGridQuery | |
| int | Pass { -1 } |
| 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 |
Friends | |
| class | vtkCellGridToUnstructuredGrid |
Additional Inherited Members | |
| Static Protected Member Functions inherited from vtkObjectBase | |
| static vtkMallocingFunction | GetCurrentMallocFunction () |
| static vtkReallocingFunction | GetCurrentReallocFunction () |
| static vtkFreeingFunction | GetCurrentFreeFunction () |
| static vtkFreeingFunction | GetAlternateFreeFunction () |
Definition at line 70 of file vtkCellGridToUnstructuredGrid.h.
| using vtkCellGridToUnstructuredGrid::Query::OutputAllocations = std::unordered_map<vtkStringToken, OutputAllocation> |
A map used to allocate space for the unstructured-grid's vtkCellArray.
This maps input cell typenames to OutputAllocation structures.
Definition at line 104 of file vtkCellGridToUnstructuredGrid.h.
| using vtkCellGridToUnstructuredGrid::Query::ConnectivityCountType = std::vector<std::atomic<int>> |
How many samples were merged into each output point.
This is counted once the samples have been merged and inverted into the weights below when the GeneratePointData pass begins.
Definition at line 214 of file vtkCellGridToUnstructuredGrid.h.
| using vtkCellGridToUnstructuredGrid::Query::ConnectivityWeightType = std::vector<float> |
The reciprocal of the number of samples merged into each output point.
This vector is only valid during the GeneratePointData pass.
Definition at line 219 of file vtkCellGridToUnstructuredGrid.h.
Passes performed by the query.
In between CountOutputs and GenerateSamples, the query class accumulates the counts responders reported into the offsets each one writes at, and allocates room for every sample.
In between GenerateSamples and GenerateConnectivity, the query class merges coincident samples into output points, allocates vtkCellArray storage, and computes the point weights.
In between GenerateConnectivity and GeneratePointData, the query class will allocate array storage for all arrays in the output vtkPointData.
| Enumerator | |
|---|---|
| CountOutputs | Responders should insert into GetOutputAllocations(). |
| GenerateSamples | Responders should write sample coordinates and their source cell + parameters. |
| GenerateConnectivity | Responders should write output point-ids, connectivity, and cell types. |
| GeneratePointData | Responders should populate point-data. |
Definition at line 118 of file vtkCellGridToUnstructuredGrid.h.
|
protecteddefault |
|
overrideprotecteddefault |
|
static |
|
static |
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class.
Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkCellGridQuery.
|
static |
|
protectedvirtual |
Reimplemented from vtkCellGridQuery.
| vtkCellGridToUnstructuredGrid::Query * vtkCellGridToUnstructuredGrid::Query::NewInstance | ( | ) | const |
|
overridevirtual |
Methods invoked by print to print information about the object including superclasses.
Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkObjectBase.
|
overridevirtual |
Override this if your query-result state requires initialization.
You may override this method to do additional work, but you must be careful to call the base method from your override.
Returning false will abort processing of the query. No error message will be printed.
Reimplemented from vtkCellGridQuery.
|
overridevirtual |
Mark the start of a pass through each cell type.
This increments the Pass ivar which responders can access.
You may override this method to do additional work, but you must be careful to call the base method from your override.
Reimplemented from vtkCellGridQuery.
|
overridevirtual |
Override this if your query-result state requires finalization.
Reimplemented from vtkCellGridQuery.
|
virtual |
Set/get how many times each input cell is halved along every parametric axis.
A level of 0 (the default) subdivides each input cell into a single linear output cell. Each increment doubles the number of subdivisions along every parametric axis of the input cell (see GetSubdivisionCount()). Negative levels are treated as 0; there is no upper limit beyond what the output can represent and what memory allows.
|
virtual |
Set/get how many times each input cell is halved along every parametric axis.
A level of 0 (the default) subdivides each input cell into a single linear output cell. Each increment doubles the number of subdivisions along every parametric axis of the input cell (see GetSubdivisionCount()). Negative levels are treated as 0; there is no upper limit beyond what the output can represent and what memory allows.
|
virtual |
Set/get how close two samples must be before they are merged into one output point, as a fraction of the input's bounding-box diagonal.
Samples that neighboring cells make of a shared face have to merge, or the output falls apart into disconnected cells. Samples of a single cell must not, or that cell collapses. The gap between a cell's own samples halves with every level, so this has to stay well below it.
|
virtual |
Set/get how close two samples must be before they are merged into one output point, as a fraction of the input's bounding-box diagonal.
Samples that neighboring cells make of a shared face have to merge, or the output falls apart into disconnected cells. Samples of a single cell must not, or that cell collapses. The gap between a cell's own samples halves with every level, so this has to stay well below it.
|
inline |
Return true if the user has asked the filter to stop.
A high level can keep a responder busy for a long time, so it needs a way to notice and give up. The query has no notion of aborting on its own, so it borrows the algorithm's.
Definition at line 162 of file vtkCellGridToUnstructuredGrid.h.
|
inline |
Return the number of subdivisions along each parametric axis.
This is 2^GetSubdivisionLevel(). Responders should use it rather than the level itself when generating output cells. Levels too large to shift by saturate, since no such subdivision could be allocated anyway.
Definition at line 169 of file vtkCellGridToUnstructuredGrid.h.
|
inlineoverridevirtual |
Force one pass per PassType through this query.
Reimplemented from vtkCellGridQuery.
Definition at line 178 of file vtkCellGridToUnstructuredGrid.h.
|
inline |
Get the request's output cell-grid.
Definition at line 181 of file vtkCellGridToUnstructuredGrid.h.
|
inline |
Get the request's input cell-grid.
Definition at line 183 of file vtkCellGridToUnstructuredGrid.h.
|
inline |
Return the data structure used in the CountOutputs pass.
Definition at line 186 of file vtkCellGridToUnstructuredGrid.h.
|
inline |
Definition at line 187 of file vtkCellGridToUnstructuredGrid.h.
| vtkDataArray * vtkCellGridToUnstructuredGrid::Query::GetOutputArray | ( | vtkCellAttribute * | inputAttribute | ) |
Return an output attribute (or null).
|
inline |
Return the array holding one candidate output point per sample.
During the GenerateSamples pass, responders must fill the tuples in [SampleOffset, SampleOffset + NumberOfSamples) of their allocation with the world coordinates of every sample they take. Coincident samples are what stitches neighboring cells together, so responders should not try to avoid emitting them: the query merges them afterwards.
The array is released once the samples have been merged, so it is only valid during the GenerateSamples pass.
Definition at line 202 of file vtkCellGridToUnstructuredGrid.h.
|
inline |
Map a sample index to the output point the sample was merged into.
This is only valid from the GenerateConnectivity pass onwards. It is indexed exactly like GetSampleCoordinates() was.
Definition at line 208 of file vtkCellGridToUnstructuredGrid.h.
|
inline |
Definition at line 220 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
Merge coincident samples and allocate the output points they became.
|
friend |
Definition at line 223 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
Definition at line 227 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
Definition at line 228 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
How many times each cell is halved per axis (see SetSubdivisionLevel()).
Definition at line 231 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
The relative distance within which samples merge (see SetPointMergeTolerance()).
Definition at line 233 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
The algorithm running this query, used only to poll for an abort.
Definition at line 235 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
Map output cell-typename to input cell-typename to count (offset after the AllocateOutputs pass has run).
Definition at line 239 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
Definition at line 241 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
One candidate output point per sample, before coincident ones merge.
Definition at line 243 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
The output point each sample was merged into.
Definition at line 245 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
The number of samples merged into each output point.
Definition at line 247 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
The reciprocal of every entry in ConnectivityCount.
Definition at line 249 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
Totals over every cell type, accumulated with the offsets below.
Definition at line 251 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
Definition at line 252 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
Storage handed to the output vtkCellArray, written by index.
Definition at line 254 of file vtkCellGridToUnstructuredGrid.h.
|
protected |
Definition at line 255 of file vtkCellGridToUnstructuredGrid.h.