Changeset 343
- Timestamp:
- 10/30/02 23:00:25 (6 years ago)
- Files:
-
- trunk/RBFoundation/RBFoundation/SubObs/LogicRules/OrderedListCollection.py (modified) (1 diff)
- trunk/RBRapier/RBRapier/Renderer/AttributeMgr.py (modified) (4 diffs)
- trunk/RBRapier/RBRapier/Renderer/BufferMgr.py (modified) (4 diffs)
- trunk/RBRapier/RBRapier/Renderer/ChangeBaseMgr.py (modified) (1 diff)
- trunk/RBRapier/RBRapier/Renderer/Environment/Buffers.py (modified) (7 diffs)
- trunk/RBRapier/RBRapier/Renderer/SequenceMgr.py (modified) (3 diffs)
- trunk/RBRapier/RBRapier/Renderer/StateMgr.py (modified) (2 diffs)
- trunk/RBRapier/RBRapier/Renderer/View/Viewport.py (modified) (1 diff)
- trunk/RBRapier/RBRapier/Tools/RectangleBase.py (modified) (1 diff)
- trunk/RBRapier/demo (added)
- trunk/RBRapier/demo/Cube (added)
- trunk/RBRapier/demo/Cube/cubescene.py (added)
- trunk/RBRapier/demo/Cube/simplecube.py (added)
- trunk/RBRapier/demo/Cube/simplecube.skin (added)
- trunk/RBSkinning/RBSkinning/SkinContext.py (modified) (1 diff)
- trunk/RBSkinning/RBSkinning/wxTools/GLViewSetup.py (added)
- trunk/RBSkinning/RBSkinning/xmlPython/script.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/RBFoundation/RBFoundation/SubObs/LogicRules/OrderedListCollection.py
r285 r343 31 31 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 32 33 class _MatchAll(object): 34 def __cmp__(self, other): 35 # -1: less, 0: equal, 1: greater 36 return 0 37 _MatchAll = _MatchAll() 38 33 39 class OrderedListCollection(ListCollection): 40 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41 #~ Public Methods 42 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 34 44 def Add(self, Callback, *data): 35 45 wr = self._WrapCallable(Callback) 36 bisect.insort(self.collection, data + (wr,)) 46 idx = bisect.bisect_right(self.collection, data + (_MatchAll,)) 47 self.collection.insert(idx, data + (wr,)) 48 trunk/RBRapier/RBRapier/Renderer/AttributeMgr.py
r341 r343 25 25 26 26 from OpenGL import GL 27 from ChangeBaseMgr import ChangeTrackerBase27 from ChangeBaseMgr import * 28 28 29 29 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 89 89 _NeedUpdate = 1 90 90 91 def __init__(self, BitmaskDefault): 91 def __init__(self, BitmaskDefault=0): 92 ChangeTrackerBase.__init__(self) 92 93 self.Bitmask = self.BitmaskDefault = BitmaskDefault 93 94 … … 112 113 def Execute(self, context): 113 114 pass 115 Draw = Execute 114 116 115 117 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 131 133 def SequenceAdd(self, Sequence): 132 134 AttributeTrackerBase.SequenceAdd(self, Sequence) 133 self.OnBeginExecute.Add(self.OnBeginExecute)134 self.OnEndExecute.Add(self.OnEndExecute)135 Sequence.OnBeginExecute.Add(self.OnBeginExecute) 136 Sequence.OnEndExecute.Add(self.OnEndExecute) 135 137 136 138 class AttributeEffector(AttributeBaseEffector): trunk/RBRapier/RBRapier/Renderer/BufferMgr.py
r341 r343 25 25 26 26 from OpenGL import GL 27 from Foundation.AOSubjectObserver.StandardSubjects import SubjectList27 from ChangeBaseMgr import * 28 28 29 29 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 91 91 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 92 92 93 def SequenceAdd(self, Sequence):94 Sequence.OnAddELement.Add(self.OnAddElement)95 Sequence.OnRemoveELement.Add(self.OnRemoveElement)96 97 93 def OnTrackedChange(self, ChangeType, Change): 98 94 if ChangeType == 'add': … … 115 111 def Execute(self, context): 116 112 pass 113 Draw = Execute 117 114 118 115 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 128 125 def Execute(self, context): 129 126 GL.glClear(self.Bitmask) 127 Draw = Execute 130 128 trunk/RBRapier/RBRapier/Renderer/ChangeBaseMgr.py
r341 r343 48 48 49 49 def SequenceAdd(self, Sequence): 50 Sequence.OnAddE Lement.Add(self.OnAddElement)51 Sequence.OnRemoveE Lement.Add(self.OnRemoveElement)50 Sequence.OnAddElement.Add(self.OnAddElement) 51 Sequence.OnRemoveElement.Add(self.OnRemoveElement) 52 52 53 53 def OnAddElement(self, Element): trunk/RBRapier/RBRapier/Renderer/Environment/Buffers.py
r341 r343 25 25 26 26 from OpenGL import GL 27 from RBR enderer.Tools import Vector27 from RBRapier.Tools import Vector 28 28 from RBRapier.Renderer.AttributeMgr import AttributeChangeElement 29 29 from RBRapier.Renderer.BufferMgr import BufferChangeElement … … 39 39 40 40 AttributeChange = AttributeChangeElement(GL.GL_COLOR_BUFFER_BIT) 41 BufferC hange= BufferChangeElement(GL.GL_COLOR_BUFFER_BIT)41 BufferClear = BufferChangeElement(GL.GL_COLOR_BUFFER_BIT) 42 42 Value = Vector.ColorVectorProperty('Value', (0., 0., 0., 1.)) 43 43 … … 73 73 74 74 AttributeChange = AttributeChangeElement(GL.GL_DEPTH_BUFFER_BIT) 75 BufferC hange= BufferChangeElement(GL.GL_DEPTH_BUFFER_BIT)75 BufferClear = BufferChangeElement(GL.GL_DEPTH_BUFFER_BIT) 76 76 Value = 1. 77 77 … … 80 80 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 81 82 def __init__(self, Value=0.) 82 def __init__(self, Value=0.): 83 83 self.Value = Value 84 84 … … 114 114 115 115 AttributeChange = AttributeChangeElement(GL.GL_STENCIL_BUFFER_BIT) 116 BufferC hange= BufferChangeElement(GL.GL_STENCIL_BUFFER_BIT)116 BufferClear = BufferChangeElement(GL.GL_STENCIL_BUFFER_BIT) 117 117 Value = 0 118 118 … … 159 159 160 160 AttributeChange = AttributeChangeElement(GL.GL_ACCUM_BUFFER_BIT) 161 BufferC hange= BufferChangeElement(GL.GL_ACCUM_BUFFER_BIT)161 BufferClear = BufferChangeElement(GL.GL_ACCUM_BUFFER_BIT) 162 162 163 163 Value = Vector.ColorVectorProperty('Value', (0., 0., 0., 1.)) … … 179 179 180 180 def Execute(self, context): 181 GL.glClearAccum( self.Value)181 GL.glClearAccum(*self.Value.tolist()) 182 182 Draw = Execute 183 183 trunk/RBRapier/RBRapier/Renderer/SequenceMgr.py
r341 r343 24 24 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 25 26 import types 26 27 import bisect 27 28 import weakref 28 29 from Foundation.AOSubjectObserver.StandardSubjects import SubjectList 30 import StateMgr, AttributeMgr, BufferMgr 29 31 30 32 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 55 57 else: idx = bisect.bisect_left(self.Elements, (priority, _MatchAll, _MatchAll)) 56 58 if isinstance(Element, types.MethodType): 57 ElementFn, Element = Element, Element Fn.im_self59 ElementFn, Element = Element, Element.im_self 58 60 elif isinstance(getattr(Element, 'Execute', None), types.MethodType): 59 61 ElementFn = Element.Execute 60 62 self.Elements.insert(idx, (priority, ElementFn, Element)) 61 63 62 try: ElementSequenceAdd = self.Element.SequenceAdd64 try: ElementSequenceAdd = Element.SequenceAdd 63 65 except AttributeError: pass 64 66 else: ElementSequenceAdd(weakref.proxy(self)) … … 76 78 elementfn(context) 77 79 self.OnEndExecute.Update(context) 80 Draw = Execute 78 81 82 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 83 84 class RootSequence(Sequence): 85 def __init__(self): 86 Sequence.__init__(self) 87 self.StateMgr = StateMgr.StateManager() 88 self.ClientStateMgr = StateMgr.ClientStateManager() 89 self.BufferMgr = BufferMgr.BufferEffector() 90 self.AddElement(self.BufferMgr,-1) 91 self.AttributeMgr = AttributeMgr.AttributeEffector() 92 self.AddElement(self.AttributeMgr,-1) 93 94 def Execute(self, context=None): 95 self.StateMgr.Reset() 96 self.ClientStateMgr.Reset() 97 Sequence.Execute(self, self) 98 Draw = Execute 99 trunk/RBRapier/RBRapier/Renderer/StateMgr.py
r341 r343 103 103 104 104 class StateManager(StateManagerBase): 105 AttributeChange = AttributeChangeElement(GL.GL_ENABLE_BIT)105 #AttributeChange = AttributeChangeElement(GL.GL_ENABLE_BIT) 106 106 107 107 def _SetState(self, state, enabled): … … 112 112 113 113 class ClientStateManager(StateManagerBase): 114 AttributeChange = AttributeChangeElement(GL.GL_CLIENT_ENABLE_BIT)114 #AttributeChange = AttributeChangeElement(GL.GL_CLIENT_ENABLE_BIT) 115 115 116 116 def _SetState(self, state, enabled): trunk/RBRapier/RBRapier/Renderer/View/Viewport.py
r341 r343 32 32 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 33 33 34 class Viewport( UtilityBaseClasses.RectangleBase):34 class Viewport(RectangleBase.RectangleBase): 35 35 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 36 #~ Constants / Variables / Etc. trunk/RBRapier/RBRapier/Tools/RectangleBase.py
r341 r343 103 103 AspectRatio = property(_getAspectRatio) 104 104 105 def SetRectangle(self, *args): self.Rectangle[:] = self.Rectangle.__class__(args) 105 def SetRectangle(self, *args): 106 if len(args) == 1: args = args[0] 107 self.Rectangle[:] = self.Rectangle.__class__(args) 106 108 107 109 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ trunk/RBSkinning/RBSkinning/SkinContext.py
r284 r343 89 89 return next 90 90 RootContext = _RootContext 91 Root = _RootContext 91 92 92 93 def itercontext(self): trunk/RBSkinning/RBSkinning/xmlPython/script.py
r277 r343 35 35 default_settings = PySkinObject.default_settings.copy() 36 36 #default_settings['module'] = None 37 #default_settings['call'] = None 37 38 default_settings['reload'] = '0' 38 39 default_settings['args'] = '(self,)'
