Panda3D
 All Classes Functions Variables Enumerations
pgVirtualFrame.I
00001 // Filename: pgVirtualFrame.I
00002 // Created by:  drose (17Aug05)
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: PGVirtualFrame::set_clip_frame
00018 //       Access: Published
00019 //  Description: Sets the bounding rectangle of the clip frame.
00020 //               This is the size of the small window through which we
00021 //               can see the virtual canvas.  Normally, this is the
00022 //               same size as the actual frame or smaller (typically
00023 //               it is smaller by the size of the bevel, or to make
00024 //               room for scroll bars).
00025 ////////////////////////////////////////////////////////////////////
00026 INLINE void PGVirtualFrame::
00027 set_clip_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) {
00028   set_clip_frame(LVecBase4(left, right, bottom, top));
00029 }
00030 
00031 ////////////////////////////////////////////////////////////////////
00032 //     Function: PGVirtualFrame::get_clip_frame
00033 //       Access: Published
00034 //  Description: Returns the bounding rectangle of the clip frame.
00035 //               See set_clip_frame().  If has_clip_frame() is
00036 //               false, this returns the item's actual frame.
00037 ////////////////////////////////////////////////////////////////////
00038 INLINE const LVecBase4 &PGVirtualFrame::
00039 get_clip_frame() const {
00040   LightReMutexHolder holder(_lock);
00041   return _has_clip_frame ? _clip_frame : get_frame();
00042 }
00043 
00044 ////////////////////////////////////////////////////////////////////
00045 //     Function: PGVirtualFrame::has_clip_frame
00046 //       Access: Published
00047 //  Description: Returns true if the clip frame has been set; see
00048 //               set_clip_frame().  If it has not been set, objects in
00049 //               the virtual frame will not be clipped.
00050 ////////////////////////////////////////////////////////////////////
00051 INLINE bool PGVirtualFrame::
00052 has_clip_frame() const {
00053   LightReMutexHolder holder(_lock);
00054   return _has_clip_frame;
00055 }
00056 
00057 ////////////////////////////////////////////////////////////////////
00058 //     Function: PGVirtualFrame::set_canvas_transform
00059 //       Access: Published
00060 //  Description: Changes the transform of the virtual canvas.  This
00061 //               transform is applied to all child nodes of the
00062 //               canvas_node.
00063 ////////////////////////////////////////////////////////////////////
00064 INLINE void PGVirtualFrame::
00065 set_canvas_transform(const TransformState *transform) {
00066   LightReMutexHolder holder(_lock);
00067   _canvas_node->set_transform(transform);
00068 }
00069 
00070 ////////////////////////////////////////////////////////////////////
00071 //     Function: PGVirtualFrame::get_canvas_transform
00072 //       Access: Published
00073 //  Description: Returns the transform of the virtual canvas.  This
00074 //               transform is applied to all child nodes of the
00075 //               canvas_node.
00076 ////////////////////////////////////////////////////////////////////
00077 INLINE const TransformState *PGVirtualFrame::
00078 get_canvas_transform() const {
00079   LightReMutexHolder holder(_lock);
00080   return _canvas_node->get_transform();
00081 }
00082 
00083 ////////////////////////////////////////////////////////////////////
00084 //     Function: PGVirtualFrame::get_canvas_node
00085 //       Access: Published
00086 //  Description: Returns the special node that holds all of the
00087 //               children that appear in the virtual canvas.
00088 ////////////////////////////////////////////////////////////////////
00089 INLINE PandaNode *PGVirtualFrame::
00090 get_canvas_node() const {
00091   LightReMutexHolder holder(_lock);
00092   return _canvas_node;
00093 }
00094 
00095 ////////////////////////////////////////////////////////////////////
00096 //     Function: PGVirtualFrame::get_canvas_parent
00097 //       Access: Published
00098 //  Description: Returns the parent node of the canvas_node.
00099 ////////////////////////////////////////////////////////////////////
00100 INLINE PandaNode *PGVirtualFrame::
00101 get_canvas_parent() const {
00102   LightReMutexHolder holder(_lock);
00103   return _canvas_parent;
00104 }
 All Classes Functions Variables Enumerations