<commit_before>/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkHyperTreeGrid.cxx

  Copyright (c) <NAME>, <NAME>, <NAME>
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#include "vtkHyperTreeGrid.h"

#include "vtkCellData.h"
#include "vtkCellLinks.h"
#include "vtkCellType.h"
#include "vtkDoubleArray.h"
#include "vtkDataSetAttributes.h"
#include "vtkGenericCell.h"
#include "vtkHyperTreeCursor.h"
#include "vtkIdTypeArray.h"
#include "vtkInformation.h"
#include "vtkInformationDoubleVectorKey.h"
#include "vtkInformationIntegerKey.h"
#include "vtkInformationVector.h"
#include "vtkLine.h"
#include "vtkMath.h"
#include "vtkObjectFactory.h"
#include "vtkPixel.h"
#include "vtkPointData.h"
#include "vtkPoints.h"
#include "vtkTimerLog.h"
#include "vtkVoxel.h"

#include <deque>
#include <vector>

#include <assert.h>


// Issues:
// 1: Order of leaf id's due to refining nodes.  Reader could order leaves base on its own needs.
// 2: Default cell interface creates connectivity arrays (effectively unstructured grid) to support random
//    access to cells.  A serial iterator would be much more efficient.

vtkInformationKeyMacro(vtkHyperTreeGrid, LEVELS, Integer);
vtkInformationKeyMacro(vtkHyperTreeGrid, DIMENSION, Integer);
vtkInformationKeyRestrictedMacro(vtkHyperTreeGrid, SIZES, DoubleVector, 3 );

//===================================================
// This internal class is used as a supperclass
// by the templated Compact class. All methods are pure virtual.
// I assume this is done to hide templates.
class vtkHyperTreeInternal
  : public vtkObject
{
public:
  vtkTypeMacro(vtkHyperTreeInternal,vtkObject);
  virtual void Initialize()=0;
  virtual vtkHyperTreeCursor *NewCursor()=0;
  virtual vtkIdType GetNumberOfLeaves()=0;
  virtual int GetNumberOfNodes()=0;
  virtual int GetBranchFactor()=0;
  virtual int GetDimension()=0;

  // Description:
  // Return the number of levels.
  // \post result_greater_or_equal_to_one: result>=1
  virtual vtkIdType GetNumberOfLevels()=0;

  // Description:
  // Subdivide node pointed by cursor, only if its a leaf.
  // At the end, cursor points on the node that used to be leaf.
  // \pre leaf_exists: leaf!=0
  // \pre is_a_leaf: leaf->CurrentIsLeaf()
  virtual void SubdivideLeaf(vtkHyperTreeCursor *leaf)=0;

  // Description:
  // Returns the actual memory size in kilobytes.
  // Ignores the attribute array.
  virtual unsigned int GetActualMemorySize() = 0;<commit_msg>Consistent formatting of pure virtual methods<commit_after>/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkHyperTreeGrid.cxx

  Copyright (c) <NAME>, <NAME>, <NAME>
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#include "vtkHyperTreeGrid.h"

#include "vtkCellData.h"
#include "vtkCellLinks.h"
#include "vtkCellType.h"
#include "vtkDoubleArray.h"
#include "vtkDataSetAttributes.h"
#include "vtkGenericCell.h"
#include "vtkHyperTreeCursor.h"
#include "vtkIdTypeArray.h"
#include "vtkInformation.h"
#include "vtkInformationDoubleVectorKey.h"
#include "vtkInformationIntegerKey.h"
#include "vtkInformationVector.h"
#include "vtkLine.h"
#include "vtkMath.h"
#include "vtkObjectFactory.h"
#include "vtkPixel.h"
#include "vtkPointData.h"
#include "vtkPoints.h"
#include "vtkTimerLog.h"
#include "vtkVoxel.h"

#include <deque>
#include <vector>

#include <assert.h>


// Issues:
// 1: Order of leaf id's due to refining nodes.  Reader could order leaves base on its own needs.
// 2: Default cell interface creates connectivity arrays (effectively unstructured grid) to support random
//    access to cells.  A serial iterator would be much more efficient.

vtkInformationKeyMacro(vtkHyperTreeGrid, LEVELS, Integer);
vtkInformationKeyMacro(vtkHyperTreeGrid, DIMENSION, Integer);
vtkInformationKeyRestrictedMacro(vtkHyperTreeGrid, SIZES, DoubleVector, 3 );

//===================================================
// This internal class is used as a supperclass
// by the templated Compact class. All methods are pure virtual.
// I assume this is done to hide templates.
class vtkHyperTreeInternal
  : public vtkObject
{
public:
  vtkTypeMacro(vtkHyperTreeInternal,vtkObject);
  virtual void Initialize()=0;
  virtual vtkHyperTreeCursor *NewCursor() = 0;
  virtual vtkIdType GetNumberOfLeaves() = 0;
  virtual int GetNumberOfNodes() = 0;
  virtual int GetBranchFactor() = 0;
  virtual int GetDimension() = 0;

  // Description:
  // Return the number of levels.
  // \post result_greater_or_equal_to_one: result>=1
  virtual vtkIdType GetNumberOfLevels() = 0;

  // Description:
  // Subdivide node pointed by cursor, only if its a leaf.
  // At the end, cursor points on the node that used to be leaf.
  // \pre leaf_exists: leaf!=0
  // \pre is_a_leaf: leaf->CurrentIsLeaf()
  virtual void SubdivideLeaf( vtkHyperTreeCursor* leaf ) = 0;

  // Description:
  // Returns the actual memory size in kilobytes.
  // Ignores the attribute array.
  virtual unsigned int GetActualMemorySize() = 0;
{'fraction_non_alphanumeric': 0.16011138183083884, 'fraction_numerical': 0.004872955099199443, 'mean_word_length': 4.986458333333333, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4652819', 'n_tokens_mistral': 1792, 'n_tokens_neox': 1710, 'n_words': 536}