49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
// Filename: indexRemapper.h
|
|
// Created by: drose (05Aug00)
|
|
//
|
|
////////////////////////////////////////////////////////////////////
|
|
//
|
|
// PANDA 3D SOFTWARE
|
|
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
|
//
|
|
// All use of this software is subject to the terms of the revised BSD
|
|
// license. You should have received a copy of this license along
|
|
// with this source code in a file named "LICENSE."
|
|
//
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef INDEXREMAPPER_H
|
|
#define INDEXREMAPPER_H
|
|
|
|
#include "dtoolbase.h"
|
|
|
|
#include <map>
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Class : IndexRemapper
|
|
// Description : This class manages a mapping of integers to integers.
|
|
// It's used in this package to resequence some or all
|
|
// of the index numbers in the database to a different
|
|
// sequence.
|
|
//
|
|
// This class is just a wrapper around STL map. The
|
|
// only reason it exists is because Microsoft can't
|
|
// export STL map outside of the DLL.
|
|
////////////////////////////////////////////////////////////////////
|
|
class EXPCL_DTOOLCONFIG IndexRemapper {
|
|
public:
|
|
IndexRemapper();
|
|
~IndexRemapper();
|
|
|
|
void clear();
|
|
void add_mapping(int from, int to);
|
|
|
|
bool in_map(int from) const;
|
|
int map_from(int from) const;
|
|
|
|
private:
|
|
map<int, int> _map_int;
|
|
};
|
|
|
|
#endif
|