00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CULLPLANES_H
00016 #define CULLPLANES_H
00017
00018 #include "pandabase.h"
00019 #include "referenceCount.h"
00020 #include "nodePath.h"
00021 #include "boundingHexahedron.h"
00022 #include "boundingPlane.h"
00023 #include "pointerTo.h"
00024 #include "luse.h"
00025 #include "deletedChain.h"
00026
00027 class ClipPlaneAttrib;
00028 class OccluderEffect;
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 class EXPCL_PANDA_PGRAPH CullPlanes : public ReferenceCount {
00047 protected:
00048 INLINE CullPlanes();
00049 INLINE CullPlanes(const CullPlanes ©);
00050 INLINE void operator = (const CullPlanes ©);
00051
00052 public:
00053 INLINE ~CullPlanes();
00054 ALLOC_DELETED_CHAIN(CullPlanes);
00055
00056 INLINE bool is_empty() const;
00057
00058 static CPT(CullPlanes) make_empty();
00059 CPT(CullPlanes) xform(const LMatrix4 &mat) const;
00060 CPT(CullPlanes) apply_state(const CullTraverser *trav,
00061 const CullTraverserData *data,
00062 const ClipPlaneAttrib *net_attrib,
00063 const ClipPlaneAttrib *off_attrib,
00064 const OccluderEffect *node_effect) const;
00065 CPT(CullPlanes) do_cull(int &result, CPT(RenderState) &state,
00066 const GeometricBoundingVolume *node_gbv) const;
00067
00068 CPT(CullPlanes) remove_plane(const NodePath &clip_plane) const;
00069 CPT(CullPlanes) remove_occluder(const NodePath &occluder) const;
00070
00071 void write(ostream &out) const;
00072
00073 private:
00074 typedef pmap<NodePath, PT(BoundingPlane) > Planes;
00075 Planes _planes;
00076
00077 typedef pmap<NodePath, PT(BoundingHexahedron) > Occluders;
00078 Occluders _occluders;
00079 };
00080
00081 #include "cullPlanes.I"
00082
00083 #endif