/*
* Copyright 2018-2021 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
*
* Restricted Rights Legend
*
* Use, duplication, or disclosure of this
* software and its documentation by the
* Government is subject to restrictions as
* set forth in subdivision [(b)(3)(ii)] of
* the Rights in Technical Data and Computer
* Software clause at 52.227-7013.
*/
#ifndef __INCLUDED_GLTF_GLTFUTILS__
#define __INCLUDED_GLTF_GLTFUTILS__
#include "GLTFCommon.h"
namespace ANSYS { namespace AVZ { namespace GLTFWriter {
namespace Utils {
GLTFWRITERSPEC void ComputeElementNormals3(const unsigned int numVertices,
const float *vertices,
const unsigned int numElements,
const unsigned int elementSize,
const unsigned short *indices,
float *normals
);
GLTFWRITERSPEC void ComputeElementNormals3(const unsigned int numVertices,
const float *vertices,
const unsigned int numElements,
const unsigned int elementSize,
const unsigned int *indices,
float *normals
);
GLTFWRITERSPEC void ComputeVertexNormals3(const unsigned int numVertices,
const float *vertices,
const unsigned int numElements,
const unsigned int elementSize,
const unsigned short *indices,
float *normals
);
GLTFWRITERSPEC void ComputeVertexNormals3(const unsigned int numVertices,
const float *vertices,
const unsigned int numElements,
const unsigned int elementSize,
const unsigned int *indices,
float *normals
);
#if 0
GLTFWRITERSPEC unsigned int CreateVectors(unsigned int resolution,
float offset,
unsigned int numLocations,
const float *locations,
const float *lengths,
const float *directions,
std::vector<float> &vertices,
std::vector<unsigned int> &indices,
std::vector<unsigned int> &newToOld
);
GLTFWRITERSPEC void CreateStreamTubes(unsigned int resolution,
float diameter,
unsigned int numLines,
const unsigned int *lineLengths,
const float *locations,
std::vector<float> &vertices,
std::vector<unsigned int> &indices,
std::vector<unsigned int> &newToOld
);
#endif
class Repack
{
protected:
virtual ~Repack() {}
public:
static GLTFWRITERSPEC Repack *Create(unsigned int elementCount,
unsigned int elementSize,
const unsigned int *indices
);
static GLTFWRITERSPEC void Destroy(Repack *packer);
GLTFWRITERSPEC virtual unsigned int NumPacks() const = 0;
GLTFWRITERSPEC virtual unsigned int NumAttributes(unsigned int packNum
) const = 0;
GLTFWRITERSPEC virtual const int *ConstructRepackAttribute(const unsigned int *indices,
unsigned int attributeSize,
const int *attributeData,
unsigned int packNum
) = 0;
GLTFWRITERSPEC virtual const float *ConstructRepackAttribute(const unsigned int *indices,
unsigned int attributeSize,
const float *attributeData,
unsigned int packNum
) = 0;
GLTFWRITERSPEC virtual unsigned int NumElements(unsigned int packNum
) const = 0;
GLTFWRITERSPEC virtual const unsigned short *ConstructRepackIndex(const unsigned int *indices,
unsigned int packNum
) = 0;
};
};
} } }
#endif
GLTFUtils.h
Was this page helpful?