OpenStructure
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
stage
lib64
python2.7
site-packages
ost
gui
scene
scene_observer_impl.py
Go to the documentation of this file.
1
#------------------------------------------------------------------------------
2
# This file is part of the OpenStructure project <www.openstructure.org>
3
#
4
# Copyright (C) 2008-2011 by the OpenStructure authors
5
#
6
# This library is free software; you can redistribute it and/or modify it under
7
# the terms of the GNU Lesser General Public License as published by the Free
8
# Software Foundation; either version 3.0 of the License, or (at your option)
9
# any later version.
10
# This library is distributed in the hope that it will be useful, but WITHOUT
11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13
# details.
14
#
15
# You should have received a copy of the GNU Lesser General Public License
16
# along with this library; if not, write to the Free Software Foundation, Inc.,
17
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
#------------------------------------------------------------------------------
19
# -*- coding: utf-8 -*-
20
21
import
sys
22
from
ost
import
gui
23
from
ost
import
gfx
24
25
class
SceneObserverImpl
(
gfx.SceneObserver
):
26
def
__init__
(self):
27
gfx.SceneObserver.__init__(self)
28
self.
obs_
= list()
29
30
def
AttachObserver
(self, ob):
31
self.obs_.append(ob)
32
33
def
DettachObserver
(self, ob):
34
self.obs_.remove(ob)
35
36
def
NodeAdded
(self, node):
37
for
ob
in
self.
obs_
:
38
if
hasattr(ob,
"NodeAdded"
):
39
ob.NodeAdded(node)
40
41
def
NodeRemoved
(self, node):
42
for
ob
in
self.
obs_
:
43
if
hasattr(ob,
"NodeRemoved"
):
44
ob.NodeRemoved(node)
45
46
def
NodeChanged
(self, node):
47
for
ob
in
self.
obs_
:
48
if
hasattr(ob,
"NodeChanged"
):
49
ob.NodeChanged(node)
50
51
def
SelectionModeChanged
(self, sel_mode):
52
for
ob
in
self.
obs_
:
53
if
hasattr(ob,
"SelectionModeChanged"
):
54
ob.SelectionModeChanged(node)
55
56
def
SelectionChanged
(self, obj, sel):
57
for
ob
in
self.
obs_
:
58
if
hasattr(ob,
"SelectionChanged"
):
59
ob.SelectionChanged(node)
60
61
def
NodeTransformed
(self, node):
62
for
ob
in
self.
obs_
:
63
if
hasattr(ob,
"NodeTransformed"
):
64
ob.NodeTransformed(node)
65
66
def
NodeRemovedDefault
(self, node):
67
for
ob
in
self.
obs_
:
68
if
hasattr(ob,
"NodeRemovedDefault"
):
69
ob.NodeRemovedDefault(node)
70
71
def
RenderModeChanged
(self, node):
72
for
ob
in
self.
obs_
:
73
if
hasattr(ob,
"RenderModeChanged"
):
74
ob.RenderModeChanged(node)
ost::gui.scene.scene_observer_impl.SceneObserverImpl.AttachObserver
def AttachObserver
Definition:
scene_observer_impl.py:30
ost::gui.scene.scene_observer_impl.SceneObserverImpl.SelectionChanged
def SelectionChanged
Definition:
scene_observer_impl.py:56
ost::gui.scene.scene_observer_impl.SceneObserverImpl.__init__
def __init__
Definition:
scene_observer_impl.py:26
ost::gui.scene.scene_observer_impl.SceneObserverImpl.DettachObserver
def DettachObserver
Definition:
scene_observer_impl.py:33
ost::gui.scene.scene_observer_impl.SceneObserverImpl.NodeAdded
def NodeAdded
Definition:
scene_observer_impl.py:36
ost::gfx::SceneObserver
Interface for observing graphical objects.
Definition:
scene_observer.hh:41
ost::gui.scene.scene_observer_impl.SceneObserverImpl
Definition:
scene_observer_impl.py:25
ost::gui.scene.scene_observer_impl.SceneObserverImpl.obs_
obs_
Definition:
scene_observer_impl.py:28
ost::gui.scene.scene_observer_impl.SceneObserverImpl.SelectionModeChanged
def SelectionModeChanged
Definition:
scene_observer_impl.py:51
ost::gui.scene.scene_observer_impl.SceneObserverImpl.RenderModeChanged
def RenderModeChanged
Definition:
scene_observer_impl.py:71
ost::gui.scene.scene_observer_impl.SceneObserverImpl.NodeChanged
def NodeChanged
Definition:
scene_observer_impl.py:46
ost::gui.scene.scene_observer_impl.SceneObserverImpl.NodeTransformed
def NodeTransformed
Definition:
scene_observer_impl.py:61
ost::gui.scene.scene_observer_impl.SceneObserverImpl.NodeRemoved
def NodeRemoved
Definition:
scene_observer_impl.py:41
ost::gui.scene.scene_observer_impl.SceneObserverImpl.NodeRemovedDefault
def NodeRemovedDefault
Definition:
scene_observer_impl.py:66
Generated by
1.8.5