00001 // Filename: geomDrawCallbackData.I 00002 // Created by: drose (13Mar09) 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 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: GeomDrawCallbackData::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE GeomDrawCallbackData:: 00022 GeomDrawCallbackData(CullableObject *obj, GraphicsStateGuardianBase *gsg, 00023 bool force) : 00024 _obj(obj), 00025 _gsg(gsg), 00026 _force(force), 00027 _lost_state(true) 00028 { 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: GeomDrawCallbackData::get_object 00033 // Access: Published 00034 // Description: Returns a pointer to the particular object that is 00035 // being drawn. 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE CullableObject *GeomDrawCallbackData:: 00038 get_object() const { 00039 return _obj; 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: GeomDrawCallbackData::get_gsg 00044 // Access: Published 00045 // Description: Returns a pointer to the current GSG. 00046 //////////////////////////////////////////////////////////////////// 00047 INLINE GraphicsStateGuardianBase *GeomDrawCallbackData:: 00048 get_gsg() const { 00049 return _gsg; 00050 } 00051 00052 //////////////////////////////////////////////////////////////////// 00053 // Function: GeomDrawCallbackData::get_force 00054 // Access: Published 00055 // Description: Returns true if any required data should be forced 00056 // into memory if necessary to render the object, or 00057 // false if the object should be omitted if some of the 00058 // data is not available (at least until the data 00059 // becomes available later). 00060 //////////////////////////////////////////////////////////////////// 00061 INLINE bool GeomDrawCallbackData:: 00062 get_force() const { 00063 return _force; 00064 } 00065 00066 //////////////////////////////////////////////////////////////////// 00067 // Function: GeomDrawCallbackData::set_lost_state 00068 // Access: Published 00069 // Description: Sets the lost_state flag. If this is true, the 00070 // callback does not have to be quite so careful to 00071 // clean up after itself; Panda will assume that the 00072 // graphics state is in an unknown state after the 00073 // callback has finished, and will issue all the 00074 // necessary calls to restore it. If this is false, 00075 // Panda will assume the callback will leave the 00076 // graphics state exactly as it came in, and won't 00077 // bother to try to restore it. The default is true. 00078 //////////////////////////////////////////////////////////////////// 00079 INLINE void GeomDrawCallbackData:: 00080 set_lost_state(bool lost_state) { 00081 _lost_state = lost_state; 00082 } 00083 00084 //////////////////////////////////////////////////////////////////// 00085 // Function: GeomDrawCallbackData::get_lost_state 00086 // Access: Published 00087 // Description: Returns the lost_state flag. See set_lost_state(). 00088 //////////////////////////////////////////////////////////////////// 00089 INLINE bool GeomDrawCallbackData:: 00090 get_lost_state() const { 00091 return _lost_state; 00092 }