Panda3D
Loading...
Searching...
No Matches
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 */
21set_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 */
29INLINE const LVecBase4 &PGVirtualFrame::
30get_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 */
40has_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 */
50set_canvas_transform(const TransformState *transform) {
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 */
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 */
70get_canvas_node() const {
71 LightReMutexHolder holder(_lock);
72 return _canvas_node;
73}
74
75/**
76 * Returns the parent node of the canvas_node.
77 */
79get_canvas_parent() const {
80 LightReMutexHolder holder(_lock);
81 return _canvas_parent;
82}
Similar to MutexHolder, but for a light reentrant mutex.
const LVecBase4 & get_frame() const
Returns the bounding rectangle of the item.
Definition pgItem.I:106
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.
bool has_clip_frame() const
Returns true if the clip frame has been set; see set_clip_frame().
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.
PandaNode * get_canvas_node() const
Returns the special node that holds all of the children that appear in the virtual canvas.
A basic node of the scene graph or data graph.
Definition pandaNode.h:65
Indicates a coordinate-system transform on vertices.