vcglib/apps/nexus/vert_remap.h

80 lines
2.9 KiB
C
Raw Normal View History

2004-06-24 16:32:45 +02:00
/****************************************************************************
* VCGLib o o *
* Visual and Computer Graphics Library o o *
* _ O _ *
* Copyright(C) 2004 \/)\/ *
* Visual Computing Lab /\/| *
* ISTI - Italian National Research Council | *
* \ *
* All rights reserved. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
* for more details. *
* *
****************************************************************************/
/****************************************************************************
History
$Log: not supported by cvs2svn $
2004-10-01 18:00:12 +02:00
Revision 1.3 2004/07/02 17:41:37 ponchio
Debug.
2004-07-02 19:42:43 +02:00
Revision 1.2 2004/07/02 13:02:00 ponchio
Backup.
2004-07-02 15:02:00 +02:00
Revision 1.1 2004/06/24 14:32:45 ponchio
Moved from wrap/nexus
2004-06-24 16:32:45 +02:00
Revision 1.1 2004/06/24 14:18:58 ponchio
Created
****************************************************************************/
#ifndef NXS_VERTEX_REMAP_H
#define NXS_VERTEX_REMAP_H
2004-10-01 18:00:12 +02:00
#include <assert.h>
2004-06-24 16:32:45 +02:00
#include <string>
#include "vfile.h"
#include "mfhash.h"
namespace nxs {
class VertRemap {
public:
2004-07-02 19:42:43 +02:00
~VertRemap() { Close(); }
2004-06-24 16:32:45 +02:00
bool Create(const std::string &file);
bool Load(const std::string &file);
2004-07-02 19:42:43 +02:00
void Close();
2004-06-24 16:32:45 +02:00
void Resize(unsigned int n_vert);
unsigned int Size();
unsigned int Count(unsigned int key);
void Insert(unsigned int key, unsigned int value);
unsigned int GetValue(unsigned int key); //return first value
template <class C> void GetValues(unsigned int key,
C &container) {
assert(key < Size());
container.clear();
if(all[key] == 0xffffffff) return;
2004-07-02 19:42:43 +02:00
// container.push_back(all[key]);
borders.GetValues(key, container);
container.insert(all[key]);
2004-06-24 16:32:45 +02:00
}
VFile<unsigned int> all;
MFHash borders;
};
} //namespace bmt
#endif