Panda3D
pgVirtualFrame.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file pgVirtualFrame.I
10  * @author drose
11  * @date 2005-08-17
12  */
13 
14 /**
15  * Sets the bounding rectangle of the clip frame. This is the size of the
16  * small window through which we can see the virtual canvas. Normally, this
17  * is the same size as the actual frame or smaller (typically it is smaller by
18  * the size of the bevel, or to make room for scroll bars).
19  */
20 INLINE void PGVirtualFrame::
21 set_clip_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) {
22  set_clip_frame(LVecBase4(left, right, bottom, top));
23 }
24 
25 /**
26  * Returns the bounding rectangle of the clip frame. See set_clip_frame().
27  * If has_clip_frame() is false, this returns the item's actual frame.
28  */
29 INLINE const LVecBase4 &PGVirtualFrame::
30 get_clip_frame() const {
31  LightReMutexHolder holder(_lock);
32  return _has_clip_frame ? _clip_frame : get_frame();
33 }
34 
35 /**
36  * Returns true if the clip frame has been set; see set_clip_frame(). If it
37  * has not been set, objects in the virtual frame will not be clipped.
38  */
39 INLINE bool PGVirtualFrame::
40 has_clip_frame() const {
41  LightReMutexHolder holder(_lock);
42  return _has_clip_frame;
43 }
44 
45 /**
46  * Changes the transform of the virtual canvas. This transform is applied to
47  * all child nodes of the canvas_node.
48  */
49 INLINE void PGVirtualFrame::
51  LightReMutexHolder holder(_lock);
52  _canvas_node->set_transform(transform);
53 }
54 
55 /**
56  * Returns the transform of the virtual canvas. This transform is applied to
57  * all child nodes of the canvas_node.
58  */
59 INLINE const TransformState *PGVirtualFrame::
61  LightReMutexHolder holder(_lock);
62  return _canvas_node->get_transform();
63 }
64 
65 /**
66  * Returns the special node that holds all of the children that appear in the
67  * virtual canvas.
68  */
70 get_canvas_node() const {
71  LightReMutexHolder holder(_lock);
72  return _canvas_node;
73 }
74 
75 /**
76  * Returns the parent node of the canvas_node.
77  */
80  LightReMutexHolder holder(_lock);
81  return _canvas_parent;
82 }
bool has_clip_frame() const
Returns true if the clip frame has been set; see set_clip_frame().
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
Indicates a coordinate-system transform on vertices.
void set_clip_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top)
Sets the bounding rectangle of the clip frame.
void set_canvas_transform(const TransformState *transform)
Changes the transform of the virtual canvas.
const TransformState * get_canvas_transform() const
Returns the transform of the virtual canvas.
const LVecBase4 & get_clip_frame() const
Returns the bounding rectangle of the clip frame.
PandaNode * get_canvas_parent() const
Returns the parent node of the canvas_node.
Similar to MutexHolder, but for a light reentrant mutex.
PandaNode * get_canvas_node() const
Returns the special node that holds all of the children that appear in the virtual canvas.
const LVecBase4 & get_frame() const
Returns the bounding rectangle of the item.
Definition: pgItem.I:106