##

STLLoader.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_STLLOADER_HH_
#define _GAZEBO_STLLOADER_HH_
#include <stdint.h>
#include <string>
#include "gazebo/common/MeshLoader.hh"
#include "gazebo/util/system.hh"
#define LINE_MAX_LEN 256
#define COR3_MAX 200000
#define ORDER_MAX 10
#define FACE_MAX 200000
namespace gazebo
{
namespace common
{
class GZ_COMMON_VISIBLE STLLoader : public MeshLoader
{
public: STLLoader();
public: virtual ~STLLoader();
public: virtual Mesh *Load(const std::string &_filename);
private: bool ReadAscii(FILE *_filein, Mesh *_mesh);
private: bool ReadBinary(FILE *_filein, Mesh *_mesh);
private: bool Leqi(char* _string1, char* _string2);
private: int RcolFind(float _a[][COR3_MAX], int _m, int _n, float _r[]);
private: uint32_t LongIntRead(FILE *_filein);
private: bool ShortIntRead(FILE *_filein, uint16_t &_value);
private: bool FloatRead(FILE *_filein, double &_value);
};
}
}
#endif
gazebo::common::STLLoader
Class used to load STL mesh files.
Definition: STLLoader.hh:40
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
COR3_MAX
#define COR3_MAX
Definition: STLLoader.hh:27
common
common
Definition: FuelModelDatabase.hh:37
system.hh
gazebo::common::STLLoader::~STLLoader
virtual ~STLLoader()
Destructor.
gazebo::common::MeshLoader
Base class for loading meshes.
Definition: MeshLoader.hh:36
gazebo::common::Mesh
A 3D mesh.
Definition: Mesh.hh:42
gazebo::common::STLLoader::STLLoader
STLLoader()
Constructor.
MeshLoader.hh
gazebo::common::STLLoader::Load
virtual Mesh * Load(const std::string &_filename)
Creates a new mesh and loads the data from a file.