1 #ifndef _OSG_MODEL_REQUEST_H_
2 #define _OSG_MODEL_REQUEST_H_
4 #include "OSGContribBackgroundLoaderDef.h"
6 #include <boost/shared_ptr.hpp>
7 #include <boost/weak_ptr.hpp>
8 #include <boost/enable_shared_from_this.hpp>
12 #include "OSGRequest.h"
13 #include "OSGChangeList.h"
17 OSG_GEN_MEMOBJPTR(ChangeList
);
20 typedef boost::shared_ptr
<ModelRequest
> ModelRequestPtr
;
21 typedef boost::weak_ptr
<ModelRequest
> ModelRequestWeakPtr
;
23 /** A request for loading a model.
25 * note: We hold on using refptrs, so all objects passed to us must have a
29 class OSG_CONTRIBBACKGROUNDLOADER_DLLMAPPING ModelRequest
:
30 public boost::enable_shared_from_this
<ModelRequest
>, public Request
38 static ModelRequestPtr
create(void)
40 return ModelRequestPtr(new ModelRequest
);
43 virtual ~ModelRequest(void);
45 ModelRequestPtr
init(NodeRefPtr parent
, const std::string
&filename
)
49 pChangeList
= ChangeList::create();
51 return shared_from_this();
54 virtual std::string
getDescription( void );
55 virtual void execute ( void );
56 virtual void sync ( void );
58 void setVerifyModel( bool bVal
);
59 void setGraphOp (const std::string
&szVal
);
63 // Note: We use RefPtrs so the code can still work
64 // even if the original nodes have been left to cleanup in the main
65 // program. (ie. removed)
67 NodeUnrecPtr mParent
; /**< The node that we are supposed to
68 * load the model under. */
69 NodeUnrecPtr mModel
; /**< The model that we loaded. */
70 std::string mFilename
;
71 ChangeListRefPtr pChangeList
;
74 std::string szGraphOp
;
79 #endif /*_OSG_MODEL_REQUEST_H_*/