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

  Program:   Visualization Library
  Module:    StrPts.hh
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.

Copyright (c) <NAME>, <NAME>, <NAME> 1993, 1994 

=========================================================================*/
// .NAME vlStructuredPoints - topologically and geometrically regular array of data
// .SECTION Description
// vlStructuredPoints is a data object that is a concrete implementation of
// vlDataSet. vlStructuredPoints represents a geometric structure that is 
// a topological and geometrical regular array of points. Examples include
// volumes (voxel data) and pixmaps. 

#ifndef __vlStructuredPoints_h
#define __vlStructuredPoints_h

#include "DataSet.hh"
#include "StrData.hh"

class vlStructuredPoints : public vlDataSet, public vlStructuredData 
{
public:
  vlStructuredPoints();
  vlStructuredPoints(const vlStructuredPoints& v);
  ~vlStructuredPoints();
  char *GetClassName() {return "vlStructuredPoints";};
  char *GetDataType() {return "vlStructuredPoints";};
  void PrintSelf(ostream& os, vlIndent indent);

  unsigned long GetMtime();

  // dataset interface
  vlDataSet *MakeObject() {return new vlStructuredPoints(*this);};
  int GetNumberOfCells();
  int GetNumberOfPoints();
  float *GetPoint(int ptId);
  void GetPoint(int id, float x[3]);
  vlCell *GetCell(int cellId);
  int FindCell(float x[3], vlCell *cell, float tol2, int& subId, 
               float pcoords[3], float weights[MAX_CELL_SIZE]);
  int GetCellType(int cellId);
  void GetCellPoints(int cellId, vlIdList& ptIds);
  void GetPointCells(int ptId, vlIdList& cellIds);
  void ComputeBounds();

  void GetVoxelGradient(int i, int j, int k, vlScalars *s, vlFloatVectors& g);
  void GetPointGradient(int i, int j, int k, vlScalars *s, float g[3]);

  // Description:
  // Set the aspect ratio of the cubical cells that compose the structured
  // point set.
  vlSetVector3Macro(AspectRatio,float);
  vlGetVectorMacro(AspectRatio,float,3);

  // Description:
  // Set the origin of the data. The origin plus aspect ratio determine the
  // position in space of the structured points.
  vlSetVector3Macro(Origin,float);
  vlGetVectorMacro(Origin,float,3);

protected:
  void Initialize();

  float Origin[3];
  float AspectRatio[3];
};

inline void vlStructuredPoints::GetPoint(int id, float x[3])
{
  float *p=this->GetPoint(id);
  x[0] = p[0]; x[1] = p[1]; x[2] = p[2];
}

inline int vlStructuredPoints::GetNumberOfCells() 
{
  return this->vlStructuredData::_GetNumberOfCells();
}

inline int vlStructuredPoints::GetNumberOfPoints()
{
  return this->vlStructuredData::_GetNumberOfCells();
}

inline void vlStructuredPoints::GetCellPoints(int cellId, vlIdList& ptIds)
{
  this->vlStructuredData::_GetCellPoints(cellId, ptIds);
}

inline void vlStructuredPoints::GetPointCells(int ptId, vlIdList& cellIds)<commit_msg>ERR: Fixed number of points bug.<commit_after>/*=========================================================================

  Program:   Visualization Library
  Module:    StrPts.hh
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.

Copyright (c) <NAME>, <NAME>, <NAME> 1993, 1994 

=========================================================================*/
// .NAME vlStructuredPoints - topologically and geometrically regular array of data
// .SECTION Description
// vlStructuredPoints is a data object that is a concrete implementation of
// vlDataSet. vlStructuredPoints represents a geometric structure that is 
// a topological and geometrical regular array of points. Examples include
// volumes (voxel data) and pixmaps. 

#ifndef __vlStructuredPoints_h
#define __vlStructuredPoints_h

#include "DataSet.hh"
#include "StrData.hh"

class vlStructuredPoints : public vlDataSet, public vlStructuredData 
{
public:
  vlStructuredPoints();
  vlStructuredPoints(const vlStructuredPoints& v);
  ~vlStructuredPoints();
  char *GetClassName() {return "vlStructuredPoints";};
  char *GetDataType() {return "vlStructuredPoints";};
  void PrintSelf(ostream& os, vlIndent indent);

  unsigned long GetMtime();

  // dataset interface
  vlDataSet *MakeObject() {return new vlStructuredPoints(*this);};
  int GetNumberOfCells();
  int GetNumberOfPoints();
  float *GetPoint(int ptId);
  void GetPoint(int id, float x[3]);
  vlCell *GetCell(int cellId);
  int FindCell(float x[3], vlCell *cell, float tol2, int& subId, 
               float pcoords[3], float weights[MAX_CELL_SIZE]);
  int GetCellType(int cellId);
  void GetCellPoints(int cellId, vlIdList& ptIds);
  void GetPointCells(int ptId, vlIdList& cellIds);
  void ComputeBounds();

  void GetVoxelGradient(int i, int j, int k, vlScalars *s, vlFloatVectors& g);
  void GetPointGradient(int i, int j, int k, vlScalars *s, float g[3]);

  // Description:
  // Set the aspect ratio of the cubical cells that compose the structured
  // point set.
  vlSetVector3Macro(AspectRatio,float);
  vlGetVectorMacro(AspectRatio,float,3);

  // Description:
  // Set the origin of the data. The origin plus aspect ratio determine the
  // position in space of the structured points.
  vlSetVector3Macro(Origin,float);
  vlGetVectorMacro(Origin,float,3);

protected:
  void Initialize();

  float Origin[3];
  float AspectRatio[3];
};

inline void vlStructuredPoints::GetPoint(int id, float x[3])
{
  float *p=this->GetPoint(id);
  x[0] = p[0]; x[1] = p[1]; x[2] = p[2];
}

inline int vlStructuredPoints::GetNumberOfCells() 
{
  return this->vlStructuredData::_GetNumberOfCells();
}

inline int vlStructuredPoints::GetNumberOfPoints()
{
  return this->vlStructuredData::_GetNumberOfPoints();
}

inline void vlStructuredPoints::GetCellPoints(int cellId, vlIdList& ptIds)
{
  this->vlStructuredData::_GetCellPoints(cellId, ptIds);
}

inline void vlStructuredPoints::GetPointCells(int ptId, vlIdList& cellIds)
{'fraction_non_alphanumeric': 0.14797059763502718, 'fraction_numerical': 0.008309364014062001, 'mean_word_length': 5.154375614552606, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '869923', 'n_tokens_mistral': 1945, 'n_tokens_neox': 1923, 'n_words': 584}