3 * Copyright (C) 2007 Stuart Buchanan
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 #ifndef SG_MAT_MODEL_BIN_HXX
23 #define SG_MAT_MODEL_BIN_HXX
30 MatModel(const SGVec3f& p, SGMatModel *m) :
36 typedef std::vector<MatModel> MatModelList;
38 void insert(const MatModel& model)
40 float x = model.position.x();
41 float y = model.position.y();
42 float z = model.position.z();
44 if (_models.size() == 0)
57 min_x = SGMisc<float>::min(min_x, x);
58 max_x = SGMisc<float>::max(max_x, x);
60 min_y = SGMisc<float>::min(min_y, y);
61 max_y = SGMisc<float>::max(max_y, y);
63 min_z = SGMisc<float>::min(min_z, z);
64 max_z = SGMisc<float>::max(max_z, z);
67 _models.push_back(model);
70 void insert(const SGVec3f& p, SGMatModel *m)
71 { insert(MatModel(p, m)); }
73 unsigned getNumModels() const
74 { return _models.size(); }
75 const MatModel& getMatModel(unsigned i) const
76 { return _models[i]; }