Public Member Functions |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
virtual void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | SetPoints (vtkPoints *) |
virtual void | ComputeHierarchy () |
void | GetDiscreteNodeCoordinatesFromWorldPoint (int ijk[3], double pt[3], int level) |
Implementation * | GetImplementation () |
|
virtual void | SetTargetLabelCount (int) |
virtual int | GetTargetLabelCount () |
|
virtual void | SetMaximumDepth (int) |
virtual int | GetMaximumDepth () |
|
virtual void | SetTextProperty (vtkTextProperty *tprop) |
virtual vtkTextProperty * | GetTextProperty () |
|
virtual void | SetPriorities (vtkDataArray *arr) |
virtual vtkDataArray * | GetPriorities () |
|
virtual void | SetLabels (vtkAbstractArray *arr) |
virtual vtkAbstractArray * | GetLabels () |
|
virtual void | SetOrientations (vtkDataArray *arr) |
virtual vtkDataArray * | GetOrientations () |
|
virtual void | SetIconIndices (vtkIntArray *arr) |
virtual vtkIntArray * | GetIconIndices () |
|
virtual void | SetSizes (vtkDataArray *arr) |
virtual vtkDataArray * | GetSizes () |
|
virtual void | SetBoundedSizes (vtkDataArray *arr) |
virtual vtkDataArray * | GetBoundedSizes () |
|
vtkLabelHierarchyIterator * | NewIterator (int type, vtkRenderer *ren, vtkCamera *cam, double frustumPlanes[24], bool positionsAsNormals, float bucketSize[2]) |
|
virtual vtkIdType | GetNumberOfCells () |
virtual vtkCell * | GetCell (vtkIdType) |
virtual void | GetCell (vtkIdType, vtkGenericCell *) |
virtual int | GetCellType (vtkIdType) |
virtual void | GetCellPoints (vtkIdType, vtkIdList *) |
virtual void | GetPointCells (vtkIdType, vtkIdList *) |
virtual vtkIdType | FindCell (double *, vtkCell *, vtkIdType, double, int &, double *, double *) |
virtual vtkIdType | FindCell (double *, vtkCell *, vtkGenericCell *, vtkIdType, double, int &, double *, double *) |
virtual int | GetMaxCellSize () |
|
virtual vtkPoints * | GetCenterPts () |
|
virtual vtkCoincidentPoints * | GetCoincidentPoints () |
void | Initialize () |
void | CopyStructure (vtkDataSet *pd) |
unsigned long | GetMTime () |
void | ComputeBounds () |
void | Squeeze () |
unsigned long | GetActualMemorySize () |
vtkIdType | GetNumberOfPoints () |
double * | GetPoint (vtkIdType ptId) |
void | GetPoint (vtkIdType ptId, double x[3]) |
virtual vtkIdType | FindPoint (double x[3]) |
vtkIdType | FindPoint (double x, double y, double z) |
virtual vtkIdType | FindCell (double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) |
virtual vtkIdType | FindCell (double x[3], vtkCell *cell, vtkGenericCell *gencell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) |
virtual vtkPoints * | GetPoints () |
void | ShallowCopy (vtkDataObject *src) |
void | DeepCopy (vtkDataObject *src) |
virtual void | CopyAttributes (vtkDataSet *ds) |
virtual void | GetCellBounds (vtkIdType cellId, double bounds[6]) |
virtual void | GetCellTypes (vtkCellTypes *types) |
vtkCellData * | GetCellData () |
vtkPointData * | GetPointData () |
double * | GetBounds () |
void | GetBounds (double bounds[6]) |
double * | GetCenter () |
void | GetCenter (double center[3]) |
double | GetLength () |
virtual void | GetScalarRange (double range[2]) |
double * | GetScalarRange () |
int | CheckAttributes () |
virtual void | GenerateGhostLevelArray () |
virtual vtkFieldData * | GetAttributesAsFieldData (int type) |
virtual vtkIdType | GetNumberOfElements (int type) |
virtual void | GetCellNeighbors (vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds) |
virtual vtkCell * | FindAndGetCell (double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) |
int | GetDataObjectType () |
virtual vtkAlgorithmOutput * | GetProducerPort () |
void | ReleaseData () |
int | ShouldIReleaseData () |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
virtual void | Update () |
virtual void | UpdateInformation () |
virtual void | PropagateUpdateExtent () |
virtual void | TriggerAsynchronousUpdate () |
virtual void | UpdateData () |
virtual unsigned long | GetEstimatedMemorySize () |
unsigned long | GetUpdateTime () |
void | SetUpdateExtentToWholeExtent () |
unsigned long | GetPipelineMTime () |
void | CopyInformation (vtkDataObject *data) |
virtual void | CopyInformationFromPipeline (vtkInformation *request) |
void | DataHasBeenGenerated () |
virtual void | PrepareForNewData () |
virtual int | GetExtentType () |
virtual void | Crop () |
virtual vtkDataSetAttributes * | GetAttributes (int type) |
virtual int | GetAttributeTypeForArray (vtkAbstractArray *arr) |
virtual vtkSource * | GetSource () |
void | SetSource (vtkSource *s) |
virtual vtkInformation * | GetInformation () |
virtual void | SetInformation (vtkInformation *) |
virtual vtkInformation * | GetPipelineInformation () |
virtual void | SetPipelineInformation (vtkInformation *) |
virtual int | GetDataReleased () |
void | SetReleaseDataFlag (int) |
int | GetReleaseDataFlag () |
virtual void | ReleaseDataFlagOn () |
virtual void | ReleaseDataFlagOff () |
virtual void | SetFieldData (vtkFieldData *) |
virtual vtkFieldData * | GetFieldData () |
virtual void | SetUpdateExtent (int piece, int numPieces, int ghostLevel) |
void | SetUpdateExtent (int piece, int numPieces) |
virtual void | SetUpdateExtent (int x0, int x1, int y0, int y1, int z0, int z1) |
virtual void | SetUpdateExtent (int extent[6]) |
virtual int * | GetUpdateExtent () |
virtual void | GetUpdateExtent (int &x0, int &x1, int &y0, int &y1, int &z0, int &z1) |
virtual void | GetUpdateExtent (int extent[6]) |
virtual void | CopyTypeSpecificInformation (vtkDataObject *data) |
void | SetUpdatePiece (int piece) |
void | SetUpdateNumberOfPieces (int num) |
virtual int | GetUpdatePiece () |
virtual int | GetUpdateNumberOfPieces () |
void | SetUpdateGhostLevel (int level) |
virtual int | GetUpdateGhostLevel () |
virtual void | SetRequestExactExtent (int flag) |
virtual int | GetRequestExactExtent () |
virtual void | RequestExactExtentOn () |
virtual void | RequestExactExtentOff () |
virtual void | SetWholeExtent (int x0, int x1, int y0, int y1, int z0, int z1) |
virtual void | SetWholeExtent (int extent[6]) |
virtual int * | GetWholeExtent () |
virtual void | GetWholeExtent (int &x0, int &x1, int &y0, int &y1, int &z0, int &z1) |
virtual void | GetWholeExtent (int extent[6]) |
virtual void | SetWholeBoundingBox (double x0, double x1, double y0, double y1, double z0, double z1) |
virtual void | SetWholeBoundingBox (double bb[6]) |
virtual double * | GetWholeBoundingBox () |
virtual void | GetWholeBoundingBox (double &x0, double &x1, double &y0, double &y1, double &z0, double &z1) |
virtual void | GetWholeBoundingBox (double extent[6]) |
virtual void | SetMaximumNumberOfPieces (int) |
virtual int | GetMaximumNumberOfPieces () |
virtual void | CopyInformationToPipeline (vtkInformation *request, vtkInformation *input, vtkInformation *output, int forceCopy) |
void | CopyInformationToPipeline (vtkInformation *request, vtkInformation *input) |
void | SetExtentTranslator (vtkExtentTranslator *translator) |
vtkExtentTranslator * | GetExtentTranslator () |
void | GlobalReleaseDataFlagOn () |
void | GlobalReleaseDataFlagOff () |
virtual void | DebugOn () |
virtual void | DebugOff () |
unsigned char | GetDebug () |
void | SetDebug (unsigned char debugFlag) |
virtual void | Modified () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &os) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
contains an octree of labels
This class represents labels in a hierarchy used to denote rendering priority. A binary tree of labels is maintained that subdivides the bounds of the of the label anchors spatially. Which level of the tree a label occupies determines its priority; those at higher levels of the tree will be more likely to render than those at lower levels of the tree.
Pass vtkLabelHierarchy objects to a vtkLabelPlacementMapper filter for dynamic, non-overlapping, per-frame placement of labels.
Note that if we have a d-dimensional binary tree and we want a fixed number
of labels in each node (all nodes, not just leaves), we can compute the depth of tree required assuming a uniform distribution of points. Given a total of
points we know that
, where
is the cardinality of the tree (i.e., the number of nodes it contains). Because we have a uniform distribution, the tree will be uniformly subdivided and thus
, where
is the dimensionality of the input points (fixed at 3 for now). As
becomes large,
. Using this approximation, we can solve for
:
Given a set of
input label anchors, we'll compute
and then bin the anchors into tree nodes at level
of the tree. After this, all the nodes will be in the leaves of the tree and those leaves will be at the
-th level; no anchors will be in levels
. To fix that, we'll choose to move some anchors upwards. The exact number to move upwards depends on TargetLabelCount. We'll move as many up as required to have TargetLabelCount at each node.
You should avoid situations where MaximumDepth does not allow for TargetLabelCount or fewer entries at each node. The MaximumDepth is a hard limit while TargetLabelCount is a suggested optimum. You will end up with many more than TargetLabelCount entries per node and things will be sloooow.
- Tests:
- vtkLabelHierarchy (Tests)
Definition at line 79 of file vtkLabelHierarchy.h.