#ifndef _gpuCacheSubSceneOverride_h_
#define _gpuCacheSubSceneOverride_h_
#include "gpuCacheShapeNode.h"
#include "CacheReader.h"
#include <boost/shared_ptr.hpp>
#define BOOST_DATE_TIME_NO_LIB
#include <boost/date_time/posix_time/ptime.hpp>
#include <boost/date_time/microsec_time_clock.hpp>
#include <maya/MDagPathArray.h>
#include <maya/MPxSubSceneOverride.h>
#include <maya/MCallbackIdArray.h>
#include <maya/MMessage.h>
namespace GPUCache {
class ShapeNode;
{
public:
static void clear();
SubSceneOverride(
const MObject&
object);
virtual ~SubSceneOverride();
void dirtyEverything();
void dirtyRenderItems();
void dirtyVisibility();
void dirtyWorldMatrix();
void dirtyStreams();
void dirtyMaterials();
void resetDagPaths();
void registerNodeDirtyCallbacks();
void clearNodeDirtyCallbacks();
const SubNode::Ptr& getGeometry() const { return fGeometry; }
const MaterialGraphMap::Ptr& getMaterial() const { return fMaterial;}
double getTime() const { return fTimeInSeconds; }
bool castsShadows() const { return fCastsShadowsPlug.asBool(); }
bool receiveShadows() const { return fReceiveShadowsPlug.asBool(); }
class HardwareInstanceManager;
boost::shared_ptr<HardwareInstanceManager>& hardwareInstanceManager()
{ return fHardwareInstanceManager; }
private:
class HierarchyStat;
class HierarchyStatVisitor;
const boost::shared_ptr<const HierarchyStat>& getHierarchyStat() const
{ return fHierarchyStat; }
const ShapeNode* fShapeNode;
MPlug fReceiveShadowsPlug;
CacheFileEntry::BackgroundReadingState fReadingState;
SubNode::Ptr fGeometry;
MaterialGraphMap::Ptr fMaterial;
double fTimeInSeconds;
boost::posix_time::ptime fUpdateTime;
MCallbackId fInstanceAddedCallback;
MCallbackId fInstanceRemovedCallback;
MCallbackId fWorldMatrixChangedCallback;
bool fUpdateRenderItemsRequired;
bool fUpdateVisibilityRequired;
bool fUpdateWorldMatrixRequired;
bool fUpdateStreamsRequired;
bool fUpdateMaterialsRequired;
bool fOutOfViewFrustum;
bool fOutOfViewFrustumUpdated;
DisplayPref::WireframeOnShadedMode fWireOnShadedMode;
class SubNodeRenderItems;
class UpdateRenderItemsVisitor;
template<typename DERIVED> class UpdateVisitorWithPrune;
class UpdateVisibilityVisitor;
class UpdateWorldMatrixVisitor;
class UpdateStreamsVisitor;
class UpdateDiffuseColorVisitor;
class InstanceRenderItems;
typedef std::vector<boost::shared_ptr<InstanceRenderItems> > InstanceRenderItemList;
typedef std::vector<boost::shared_ptr<SubNodeRenderItems> > SubNodeRenderItemList;
InstanceRenderItemList fInstanceRenderItems;
boost::shared_ptr<const HierarchyStat> fHierarchyStat;
boost::shared_ptr<HardwareInstanceManager> fHardwareInstanceManager;
};
}
#endif