Commit a426ae23 authored by Matthias Möller's avatar Matthias Möller

size_t - unsigned conversion

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17260 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 075a4db3
......@@ -1032,7 +1032,7 @@ pick_vertices(GLState& _state, bool _front)
typename Mesh::ConstVertexIter v_it(mesh_.vertices_begin()),
v_end(mesh_.vertices_end());
if (!_state.pick_set_maximum (mesh_.n_vertices())) {
if (!_state.pick_set_maximum (static_cast<unsigned>(mesh_.n_vertices()))) {
omerr() << "MeshNode::pick_vertices: color range too small, " << "picking failed\n";
return;
}
......@@ -1109,7 +1109,7 @@ pick_edges(GLState& _state, bool _front)
{
GLenum prev_depth = _state.depthFunc();
if (!_state.pick_set_maximum (mesh_.n_edges())) {
if (!_state.pick_set_maximum (static_cast<unsigned>(mesh_.n_edges()))) {
omerr() << "MeshNode::pick_edges: color range too small, " << "picking failed\n";
return;
}
......@@ -1194,7 +1194,7 @@ pick_faces(GLState& _state)
}
if ( mesh_.n_faces() > 0 ) {
if (!_state.pick_set_maximum (mesh_.n_faces())) {
if (!_state.pick_set_maximum (static_cast<unsigned>(mesh_.n_faces()))) {
omerr() << "MeshNode::pick_faces: color range too small, " << "picking failed\n";
return;
}
......@@ -1258,7 +1258,7 @@ pick_any(GLState& _state)
return;
}
if (!_state.pick_set_maximum (numElements))
if (!_state.pick_set_maximum (static_cast<unsigned int>(numElements)))
{
omerr() << "MeshNode::pick_any: color range too small, " << "picking failed\n";
return;
......
......@@ -635,14 +635,14 @@ void StatusNodeT<Mesh, Mod>::getRenderObjects(IRenderer* _renderer,
// point list
if (points && !v_cache_.empty())
{
ro.glDrawElements(GL_POINTS, v_cache_.size(), GL_UNSIGNED_INT, &v_cache_[0]);
ro.glDrawElements(GL_POINTS, static_cast<GLsizei>(v_cache_.size()), GL_UNSIGNED_INT, &v_cache_[0]);
_renderer->addRenderObject(&ro);
}
// edge list
if (edges && !e_cache_.empty())
{
ro.glDrawElements(GL_LINES, e_cache_.size(), GL_UNSIGNED_INT, &e_cache_[0]);
ro.glDrawElements(GL_LINES, static_cast<GLsizei>(e_cache_.size()), GL_UNSIGNED_INT, &e_cache_[0]);
_renderer->addRenderObject(&ro);
}
......@@ -651,12 +651,12 @@ void StatusNodeT<Mesh, Mod>::getRenderObjects(IRenderer* _renderer,
{
if (mesh_.is_trimesh())
{
ro.glDrawElements(GL_TRIANGLES, f_cache_.size(), GL_UNSIGNED_INT, &f_cache_[0]);
ro.glDrawElements(GL_TRIANGLES, static_cast<GLsizei>(f_cache_.size()), GL_UNSIGNED_INT, &f_cache_[0]);
_renderer->addRenderObject(&ro);
}
else
{
ro.glDrawElements(GL_TRIANGLES, poly_cache.size(), GL_UNSIGNED_INT, &poly_cache[0]);
ro.glDrawElements(GL_TRIANGLES, static_cast<GLsizei>(poly_cache.size()), GL_UNSIGNED_INT, &poly_cache[0]);
_renderer->addRenderObject(&ro);
}
}
......@@ -673,7 +673,7 @@ void StatusNodeT<Mesh, Mod>::getRenderObjects(IRenderer* _renderer,
ro.vertexBuffer = 0;
ro.vertexDecl = &halfedgeVertexDecl_;
ro.glDrawArrays(GL_LINES, 0, he_points_.size() );
ro.glDrawArrays(GL_LINES, 0, static_cast<GLsizei>(he_points_.size()) );
_renderer->addRenderObject(&ro);
}
......
......@@ -601,7 +601,7 @@ getRenderObjects(ACG::IRenderer* _renderer, ACG::GLState& _state , const ACG::S
ro.setMaterial(&localMaterial);
ro.glDrawArrays(GL_QUADS, 0, text_.size() * 4);
ro.glDrawArrays(GL_QUADS, 0, static_cast<GLsizei>(text_.size()) * 4);
_renderer->addRenderObject(&ro);
}
......
......@@ -164,7 +164,7 @@ namespace OpenMesh {
return sizeof(unsigned int);
value_type::const_iterator it = _v.begin();
unsigned int N = _v.size();
unsigned int N = static_cast<unsigned int>(_v.size());
size_t bytes = IO::size_of(N);
for(;it!=_v.end(); ++it)
......@@ -178,7 +178,7 @@ namespace OpenMesh {
static size_t store(std::ostream& _os, const value_type& _v, bool _swap=false)
{
value_type::const_iterator it = _v.begin();
unsigned int N = _v.size();
unsigned int N = static_cast<unsigned int>(_v.size());
size_t bytes;
bytes = IO::store( _os, N, _swap );
......@@ -194,7 +194,7 @@ namespace OpenMesh {
static size_t restore( std::istream& _is, value_type& _v, bool _swap=false)
{
unsigned int N = _v.size();
unsigned int N = static_cast<unsigned int>(_v.size());
size_t bytes;
bytes = IO::restore( _is, N, _swap );
......
......@@ -231,7 +231,7 @@ bool typeExists( QString _name );
* \note Remember that the types are organized in a bitfield!
*/
DLLEXPORT
uint typeCount();
size_t typeCount();
/** @} */
......
......@@ -75,11 +75,11 @@ static std::map< DataType, QString > typeToString;
/** This map maps an dataType name to its id in the types vector
*/
static std::map< QString , unsigned int > stringToTypeInfo;
static std::map< QString , size_t > stringToTypeInfo;
/** This map maps an dataType id to its id in the types vector
*/
static std::map< DataType , unsigned int > typeToTypeInfo;
static std::map< DataType , size_t > typeToTypeInfo;
static QIcon dummyIcon;
......@@ -141,7 +141,7 @@ DataType addDataType(QString _name, QString _readableName) {
/// Get the id of a type with given name
DataType typeId(QString _name) {
std::map<QString, unsigned int>::iterator index = stringToTypeInfo.find( _name );
std::map<QString, size_t>::iterator index = stringToTypeInfo.find( _name );
if ( index != stringToTypeInfo.end() )
return types[ index->second ].type;
......@@ -175,7 +175,7 @@ bool typeExists( QString _name ) {
/// Return the number of registered types
uint typeCount() {
size_t typeCount() {
return types.size();
}
......@@ -192,7 +192,7 @@ std::vector< TypeInfo >::const_iterator typesEnd() {
/// Get the icon of a given dataType
QString typeIconName(QString _name) {
std::map<QString, unsigned int>::iterator index = stringToTypeInfo.find( _name );
std::map<QString, size_t>::iterator index = stringToTypeInfo.find( _name );
if ( index != stringToTypeInfo.end() )
return types[ index->second ].iconName;
......@@ -203,7 +203,7 @@ QString typeIconName(QString _name) {
/// get the icon of a given dataType
QString typeIconName(DataType _id) {
std::map<DataType, unsigned int>::iterator index = typeToTypeInfo.find(_id);
std::map<DataType, size_t>::iterator index = typeToTypeInfo.find(_id);
if ( index != typeToTypeInfo.end() )
return types[ index->second ].iconName;
......@@ -214,7 +214,7 @@ QString typeIconName(DataType _id) {
/// get the icon of a given dataType
QIcon& typeIcon(DataType _id) {
std::map<DataType, unsigned int>::iterator index = typeToTypeInfo.find(_id);
std::map<DataType, size_t>::iterator index = typeToTypeInfo.find(_id);
if ( index != typeToTypeInfo.end() )
return types[ index->second ].icon;
......@@ -226,7 +226,7 @@ QIcon& typeIcon(DataType _id) {
void setTypeIcon( DataType _id , QString _icon ) {
if ( OpenFlipper::Options::gui() ) {
std::map<DataType, unsigned int>::iterator index = typeToTypeInfo.find(_id);
std::map<DataType, size_t>::iterator index = typeToTypeInfo.find(_id);
if ( index != typeToTypeInfo.end() ) {
types[ index->second ].iconName = _icon;
......@@ -240,7 +240,7 @@ void setTypeIcon( DataType _id , QString _icon ) {
void setTypeIcon( QString _name , QString _icon ) {
if ( OpenFlipper::Options::gui() ) {
std::map<QString, unsigned int>::iterator index = stringToTypeInfo.find( _name );
std::map<QString, size_t>::iterator index = stringToTypeInfo.find( _name );
if ( index != stringToTypeInfo.end() ) {
types[ index->second ].iconName = _icon;
......@@ -254,7 +254,7 @@ void setTypeIcon( QString _name , QString _icon ) {
/// Get DataType Human readable name ( this name might change. Use the typeName insted! )
QString dataTypeName( DataType _id ) {
std::map<DataType, unsigned int>::iterator index = typeToTypeInfo.find(_id);
std::map<DataType, size_t>::iterator index = typeToTypeInfo.find(_id);
if ( index != typeToTypeInfo.end() )
return types[ index->second ].readableName ;
......@@ -267,7 +267,7 @@ QString dataTypeName( DataType _id ) {
/// Get DataType Human readable name ( this name might change. Use the typeName insted! )
QString dataTypeName( QString _typeName ) {
std::map<QString, unsigned int>::iterator index = stringToTypeInfo.find( _typeName );
std::map<QString, size_t>::iterator index = stringToTypeInfo.find( _typeName );
if ( index != stringToTypeInfo.end() )
return types[ index->second ].readableName ;
......@@ -282,7 +282,7 @@ QString dataTypeName( QString _typeName ) {
/// Set the icon for a given dataType
void setDataTypeName( DataType _id , QString _name ) {
std::map<DataType, unsigned int>::iterator index = typeToTypeInfo.find(_id);
std::map<DataType, size_t>::iterator index = typeToTypeInfo.find(_id);
if ( index != typeToTypeInfo.end() )
types[ index->second ].readableName = _name;
......@@ -293,7 +293,7 @@ void setDataTypeName( DataType _id , QString _name ) {
/// Set the icon for a given dataType
void setDataTypeName( QString _typeName , QString _name ) {
std::map<QString, unsigned int>::iterator index = stringToTypeInfo.find( _typeName );
std::map<QString, size_t>::iterator index = stringToTypeInfo.find( _typeName );
if ( index != stringToTypeInfo.end() )
types[ index->second ].readableName = _name;
......
......@@ -53,11 +53,11 @@ static std::map< UpdateType, QString > updateTypeToString;
/** This map maps an updateType name to its id in the types vector
*/
static std::map< QString , unsigned int > stringToUpdateTypeInfo;
static std::map< QString , size_t > stringToUpdateTypeInfo;
/** This map maps an updateType id to its id in the types vector
*/
static std::map< UpdateType , unsigned int > updateTypeToTypeInfo;
static std::map< UpdateType , size_t > updateTypeToTypeInfo;
/** This field defines the start id for custom updatetypes.
*/
......@@ -224,7 +224,7 @@ void initializeUpdateTypes() {
UpdateType addUpdateType(QString _name, bool _resetNeeded) {
//first check if it's already available
std::map<QString, unsigned int>::iterator index = stringToUpdateTypeInfo.find( _name );
std::map<QString, size_t>::iterator index = stringToUpdateTypeInfo.find( _name );
if ( index != stringToUpdateTypeInfo.end() )
return updateTypes[ index->second ].type;
......@@ -246,7 +246,7 @@ UpdateType addUpdateType(QString _name, bool _resetNeeded) {
/// Get the id of a type with given name
UpdateType updateType(QString _name) {
std::map<QString, unsigned int>::iterator index = stringToUpdateTypeInfo.find( _name );
std::map<QString, size_t>::iterator index = stringToUpdateTypeInfo.find( _name );
if ( index != stringToUpdateTypeInfo.end() )
return updateTypes[ index->second ].type;
......@@ -274,6 +274,6 @@ QString updateTypeName(UpdateType _id) {
}
/// Return the number of registered types
uint updateTypeCount() {
size_t updateTypeCount() {
return updateTypes.size();
}
......@@ -210,7 +210,7 @@ QString updateTypeName(UpdateType _id);
* iterate over all types.
*/
DLLEXPORT
uint updateTypeCount();
size_t updateTypeCount();
/**@}*/
......
......@@ -289,7 +289,7 @@ void MaterialPicker::slotMouseEvent(QMouseEvent* _event) {
materialInfo.key = Qt::Key_unknown;
if (shortKeyRow_.size() < supportedKeys_)
{
materialInfo.key = Qt::Key_1+shortKeyRow_.size();
materialInfo.key = Qt::Key_1+(int)shortKeyRow_.size();
shortKeyRow_[materialInfo.key] = materialListWidget_->count();
}
......@@ -411,19 +411,19 @@ void MaterialPicker::slotKeyEvent(QKeyEvent* _event)
if (shortKeyRow_.find(key) == shortKeyRow_.end())
return;
slotFillMaterialMode();
materialListWidget_->setCurrentRow(shortKeyRow_[key]);
materialListWidget_->setCurrentRow((int)shortKeyRow_[key]);
}
}
}
//------------------------------------------------------------------------------
void MaterialPicker::changeHotKey(const int &_key)
void MaterialPicker::changeHotKey(const int _key)
{
std::map<int,size_t>::iterator iter = shortKeyRow_.find(_key);
if (iter != shortKeyRow_.end())
{
//remove old key
size_t oldIndex = iter->second;
int oldIndex = (int)iter->second;
QListWidgetItem* oldItem = materialListWidget_->item(oldIndex);
//remove name
oldItem->setText( plainName(oldItem->text(),oldIndex) );
......@@ -433,7 +433,7 @@ void MaterialPicker::changeHotKey(const int &_key)
}
//set the new item (save and hint)
size_t newIndex = materialListWidget_->currentRow();
int newIndex = materialListWidget_->currentRow();
QListWidgetItem* newItem = materialListWidget_->item(newIndex);
materialList_[newIndex].key = _key;
......
......@@ -169,7 +169,7 @@ private slots:
void createContextMenu(const QPoint& _point);
/// change specified HotKey to current item
void changeHotKey(const int &_key);
void changeHotKey(const int _key);
void slotMaterialProperties();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment