Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Meakk committed Feb 2, 2024
1 parent 3a58974 commit 3a91f7e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ int TestF3DObjectFactory(int argc, char* argv[])

#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK(9, 3, 20240202)
vtkNew<vtkPointGaussianMapper> pointMapper;
pointMapper->Print(cout);
vtkF3DPointSplatMapper* pointMapperPtr = vtkF3DPointSplatMapper::SafeDownCast(pointMapper);
if (pointMapperPtr == nullptr)
{
Expand Down
12 changes: 6 additions & 6 deletions library/VTKExtensions/Rendering/Testing/TestF3DBitonicSort.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ int TestF3DBitonicSort(int argc, char* argv[])
return EXIT_SUCCESS;
}

constexpr int nbElements = 1e5;
constexpr int nbElements = 10000;

// fill CPU keys and values buffers
std::array<unsigned int, nbElements> keys;
std::array<unsigned int, nbElements> values;
std::vector<double> keys(nbElements);
std::vector<int> values(nbElements);

std::random_device dev;
std::mt19937 rng(dev());
std::uniform_int_distribution<unsigned int> dist(0, 100 * nbElements);
std::uniform_real_distribution<double> dist(0.0, 1.0);

std::generate(std::begin(keys), std::end(keys), [&]() { return dist(rng); });
std::fill(std::begin(values), std::end(values), -1); // we do not care about the values
std::fill(std::begin(values), std::end(values), 0); // we do not care about the values

// upload these buffers to the GPU
vtkNew<vtkOpenGLBufferObject> bufferKeys;
Expand All @@ -49,7 +49,7 @@ int TestF3DBitonicSort(int argc, char* argv[])

// sort
vtkNew<vtkF3DBitonicSort> sorter;
sorter->Initialize(128, VTK_UNSIGNED_INT, VTK_UNSIGNED_INT);
sorter->Initialize(128, VTK_DOUBLE, VTK_INT);
sorter->Run(vtkOpenGLRenderWindow::SafeDownCast(renWin), nbElements, bufferKeys, bufferValues);

// download sorted key buffer to CPU
Expand Down
8 changes: 5 additions & 3 deletions library/VTKExtensions/Rendering/vtkF3DBitonicSort.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "vtkF3DBitonicSortLocalDisperseCS.h"
#include "vtkF3DBitonicSortLocalSortCS.h"

#include <sstream>

//----------------------------------------------------------------------------
vtkStandardNewMacro(vtkF3DBitonicSort);

Expand All @@ -26,7 +28,7 @@ void vtkF3DBitonicSort::Initialize(int workgroupSize, int keyType, int valueType
return;
}

auto toShaderType = [](int vtkType) -> std::string
auto GetStringShaderType = [](int vtkType) -> std::string
{
switch (vtkType)
{
Expand All @@ -42,14 +44,14 @@ void vtkF3DBitonicSort::Initialize(int workgroupSize, int keyType, int valueType
return "";
};

std::string keyTypeShader = toShaderType(keyType);
std::string keyTypeShader = GetStringShaderType(keyType);
if (keyTypeShader.empty())
{
vtkErrorMacro("Invalid keyType");
return;
}

std::string valueTypeShader = toShaderType(valueType);
std::string valueTypeShader = GetStringShaderType(valueType);
if (valueTypeShader.empty())
{
vtkErrorMacro("Invalid valueType");
Expand Down
6 changes: 3 additions & 3 deletions library/VTKExtensions/Rendering/vtkF3DPointSplatMapper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class vtkF3DSplatMapperHelper : public vtkOpenGLPointGaussianMapperHelper
static vtkF3DSplatMapperHelper* New();
vtkTypeMacro(vtkF3DSplatMapperHelper, vtkOpenGLPointGaussianMapperHelper);

vtkF3DSplatMapperHelper(const vtkF3DSplatMapperHelper&) = delete;
void operator=(const vtkF3DSplatMapperHelper&) = delete;

protected:
vtkF3DSplatMapperHelper();

Expand All @@ -36,9 +39,6 @@ class vtkF3DSplatMapperHelper : public vtkOpenGLPointGaussianMapperHelper
void RenderPieceDraw(vtkRenderer* ren, vtkActor* act) override;

private:
vtkF3DSplatMapperHelper(const vtkF3DSplatMapperHelper&) = delete;
void operator=(const vtkF3DSplatMapperHelper&) = delete;

void SortSplats(vtkRenderer* ren);

vtkNew<vtkShader> DepthComputeShader;
Expand Down
5 changes: 1 addition & 4 deletions plugins/native/module/vtkF3DSplatReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ class vtkF3DSplatReader : public vtkPolyDataAlgorithm
vtkTypeMacro(vtkF3DSplatReader, vtkPolyDataAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) override;

///@{
/**
* Get/Set the file name.
* Set the file name.
*/
vtkSetMacro(FileName, std::string);
vtkGetMacro(FileName, std::string);
///@}

protected:
vtkF3DSplatReader();
Expand Down

0 comments on commit 3a91f7e

Please sign in to comment.