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