Panda3D
|
00001 // Filename: cullPlanes.h 00002 // Created by: drose (23Aug05) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 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 "clipPlaneAttrib.h" 00022 #include "boundingPlane.h" 00023 #include "pointerTo.h" 00024 #include "luse.h" 00025 #include "deletedChain.h" 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : CullPlanes 00029 // Description : This represents the set of clip planes that are 00030 // definitely in effect for the current node of the 00031 // CullTraverserData, as well as on all child nodes. 00032 // Any clip planes in this list may be safely culled 00033 // against. 00034 // 00035 // This does not include the clip planes that are in 00036 // effect now, but might later be turned off by a child 00037 // node, since we can't safely cull against such clip 00038 // planes. 00039 // 00040 // The bounding volumes in this object are transformed 00041 // for each level of the scene graph. 00042 //////////////////////////////////////////////////////////////////// 00043 class EXPCL_PANDA_PGRAPH CullPlanes : public ReferenceCount { 00044 protected: 00045 INLINE CullPlanes(); 00046 INLINE CullPlanes(const CullPlanes ©); 00047 INLINE void operator = (const CullPlanes ©); 00048 00049 public: 00050 INLINE ~CullPlanes(); 00051 ALLOC_DELETED_CHAIN(CullPlanes); 00052 00053 INLINE bool is_empty() const; 00054 00055 static CPT(CullPlanes) make_empty(); 00056 CPT(CullPlanes) xform(const LMatrix4f &mat) const; 00057 CPT(CullPlanes) apply_state(const CullTraverser *trav, 00058 const CullTraverserData *data, 00059 const ClipPlaneAttrib *net_attrib, 00060 const ClipPlaneAttrib *off_attrib) const; 00061 CPT(CullPlanes) do_cull(int &result, CPT(RenderState) &state, 00062 const GeometricBoundingVolume *node_gbv) const; 00063 00064 CPT(CullPlanes) remove_plane(const NodePath &clip_plane) const; 00065 00066 void write(ostream &out) const; 00067 00068 private: 00069 typedef pmap<NodePath, PT(BoundingPlane) > Planes; 00070 Planes _planes; 00071 }; 00072 00073 #include "cullPlanes.I" 00074 00075 #endif