28 #ifndef opengl_COpenGLScene_H
29 #define opengl_COpenGLScene_H
77 virtual ~COpenGLScene();
81 COpenGLScene & operator =( const COpenGLScene &obj );
85 COpenGLScene( const COpenGLScene &obj );
91 template<class T> inline
void insertCollection(const T &objs,const std::
string &vpn=std::
string("main")) {
92 insert(objs.begin(),objs.end(),vpn);
99 void insert(
const CRenderizablePtr &newObject,
const std::string &viewportName=std::string(
"main"));
105 template<
class T_it>
inline void insert(
const T_it &
begin,
const T_it &
end,
const std::string &vpn=std::string(
"main")) {
106 for (T_it it=begin;it!=
end;it++) insert(*it,vpn);
117 COpenGLViewportPtr getViewport(
const std::string &viewportName = std::string(
"main") )
const;
127 void clear(
bool createMainViewport =
true );
141 CRenderizablePtr getByName(
const std::string &str,
const std::string &viewportName = std::string(
"main") );
150 template <
typename T>
151 typename T::SmartPtr getByClass(
const size_t &ith = 0 )
const
156 typename T::SmartPtr o = (*it)->getByClass<T>(ith);
157 if (o.present())
return o;
159 return typename T::SmartPtr();
166 void removeObject(
const CRenderizablePtr &obj,
const std::string &viewportName = std::string(
"main") );
170 void initializeAllTextures();
180 bool saveToFile(
const std::string &fil)
const;
186 bool loadFromFile(
const std::string &fil);
196 template <
typename FUNCTOR>
197 void visitAllObjects( FUNCTOR functor)
const
202 internal_visitAllObjects(functor, *itO);
210 template <
typename FUNCTOR,
typename EXTRA_PARAM>
212 visitAllObjects( std::bind2nd(functor,userParam) );
223 template <
typename FUNCTOR>
231 internal_visitAllObjects(functor,*it);
248 template <
class T>
inline COpenGLScenePtr &operator<<(COpenGLScenePtr &s,const std::vector<T> &v) {
249 s->
insert(v.begin(),v.end());