Add unittest fixure for aiMetadata.

This commit is contained in:
Kim Kulling
2016-11-21 23:54:39 +01:00
parent eb6390a639
commit c61146f52e
5 changed files with 109 additions and 25 deletions

View File

@@ -43,6 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SpatialSort.h"
#include "ProcessHelper.h"
#include "Vertex.h"
#include <assimp/ai_assert.h>
#include <stdio.h>
using namespace Assimp;
@@ -55,9 +56,7 @@ void mydummy() {}
// ------------------------------------------------------------------------------------------------
class CatmullClarkSubdivider : public Subdivider
{
public:
void Subdivide (aiMesh* mesh, aiMesh*& out, unsigned int num, bool discard_input);
void Subdivide (aiMesh** smesh, size_t nmesh,
aiMesh** out, unsigned int num, bool discard_input);
@@ -74,8 +73,6 @@ public:
unsigned int ref;
};
typedef std::vector<unsigned int> UIntVector;
typedef std::map<uint64_t,Edge> EdgeMap;
@@ -99,7 +96,6 @@ public:
unsigned int eh_tmp0__, eh_tmp1__;
private:
void InternSubdivide (const aiMesh* const * smesh,
size_t nmesh,aiMesh** out, unsigned int num);
};
@@ -128,7 +124,8 @@ void CatmullClarkSubdivider::Subdivide (
bool discard_input
)
{
assert(mesh != out);
ai_assert(mesh != out);
Subdivide(&mesh,1,&out,num,discard_input);
}
@@ -142,12 +139,12 @@ void CatmullClarkSubdivider::Subdivide (
bool discard_input
)
{
ai_assert(NULL != smesh && NULL != out);
ai_assert( NULL != smesh );
ai_assert( NULL != out );
// course, both regions may not overlap
assert(smesh<out || smesh+nmesh>out+nmesh);
ai_assert(smesh<out || smesh+nmesh>out+nmesh);
if (!num) {
// No subdivision at all. Need to copy all the meshes .. argh.
if (discard_input) {
for (size_t s = 0; s < nmesh; ++s) {